python-mechanize/mechanize

Doc: how to just iterate over basic html elements?

hw-claudio opened this issue · 2 comments

Hi,

I am puzzled by the fact that there seems to be no docs on the simplest of operations, ie, how do i iterate over,
search, etc, basic html elements?

I can easily look for links in the page with links(), i can even regex the links, there is a lot about forms,

but I cannot find any reference in the docs on how i could, for example, capture a simple text or match a paragraph.

Does mechanize lack the ability to do anything if the information I am looking for is in a DIV somewhere, but not in a link or in a form?

Thanks

mechanize is for network handling not parsing HTML. You want to extract
information from HTML, get the raw html from mechanize, and use it with
some HTML library, such as html5-parser or BeautifulSoup or html5lib or
whatever floats your boat, mechanize does not care.

got it thanks!