user3381065 user3381065 - 14 days ago 5
Python Question

Python htlm parsing. Can i do on ready?

I'm new to python. Can i do call i get html content on

ready
state? I tried to search for something like this, but i haven't found any answer. I need to parse site where is some html that i can view only on
ready
state. Is there any variant to do this? Thanks and sorry for my english. Here is my piece of code:

import lxml.html as html
from lxml.html import tostring
import string
import re

letters = list(string.ascii_lowercase)
main_domain_stat = 'http://www.copyright.gov/onlinesp/list/'

page = html.parse('%s/a_agents.html' % (main_domain_stat))

Answer

There is no way you can get the state of readystate just with looking at the html. The html module is an html parser (you should try beautifulsoup) and you can access those kind of parameters, you will just get the html code.

I see two solutions : First, you look at something that may appears at the end of the loading. If you find it, it exists. Second, you may use selenium webdriver (python module) to test that the page is completely downloaded.