0

Imagine the websites from flight companies, that takes some time to load due to their search in other websites to find you the best flight.

If I use the following code to read a HTML page

import urllib2
url_dump = 'http://www.my_web_site.com'
response = urllib2.urlopen(url_dump)
html = response.read()
print html

What I want is to read only when the site is full loaded.

How can I achieve this in Python?

ZdaR
  • 22,343
  • 7
  • 66
  • 87
waas1919
  • 2,365
  • 7
  • 44
  • 76
  • 2
    This behaviour can be achieved using `PhantomJS` with headless browsing and not with `urllib` – ZdaR Mar 17 '17 at 17:51
  • 1
    If the site uses Ajax, that means that they do not want nor support automatic browsing. You can try, but will lose because subtle details can change and break your nice script... – Serge Ballesta Mar 17 '17 at 18:01

0 Answers0