问题
I am parsing an HTML webpage with Python and Beautiful Soup (I am open to other solutions, though). I am wondering if it is possible to parse the file based on a line of HTML, i.e., get the td tag from line3. Is this possible?
回答1:
consider this example: http://www.pythonforbeginners.com/python-on-the-web/web-scraping-with-beautifulsoup/ there is line-by-line processing and matching of href(you need td)
additionaly consider: soup.find_all("td", limit=3)
来源:https://stackoverflow.com/questions/19393524/parse-html-by-line