문제

I'm using Mechanize in Python to submit a form and view some info. The URL goes to some standard URL for the request, without the request parameters in it. Something like: xyzdomain.com/request

In the browser, it normal shows a loading icon, then displays the data. There is no change in the top of the page (header) so the full page is never reloaded, but the URL does change from /index to /request.

About 1/3 of the time, I get a httplib.IncompleteRead exception and I checked the partial HTML of the response and the page is saying "If it takes longer than 25 seconds, refresh the page."

So if I grabbed the current URL of the Mechanize Browser and used open() on it, would that have the same affect as using refresh (if Mechanize had refresh).

도움이 되었습니까?

해결책

Maybe this might help

br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)

For more: Meta Refresh

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top