Partial HTML extraction of webdriver in selenium
Don’t tell me that webdriver in selenium uses driver.page_source. I just don’t want to extract the entire HTML document every time to make a soup. Because, for a forum with a left-right structure like the one below, each content change is really a very small part of the entire HTML page. If I want to crawl down all the MOOC course comments on the entire website, how much useless work will I have to do!
However, Baidu searched the Chinese content and found no answer. So I went to Google and found that senior people in the world have already answered this question:
The main idea is to use the get_attribute method to extract innerHTML, as follows:
Verified, everything is OK:
http://www.bkjia.com/PHPjc/1112548.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1112548.htmlTechArticlePartial HTML extraction of webdriver in selenium. Don’t tell me that webdriver in selenium uses driver.page_source. I just don’t want to use it. The entire HTML document is brought up for soup every time. Because, right...