Partial HTML extraction of webdriver in selenium. Partial HTML extraction of webdriver in selenium do not tell me that the webdriver in selenium uses driver. page_source. I just don't want to submit all the HTML documents for Soup every time. Because, partial HTML extraction for webdriver in selenium
Don't tell me that the webdriver in selenium uses driver. page_source. I just don't want to submit all the HTML documents for Soup every time. For the following Forum with the left and right structure, each change in content is really a small part of the entire HTML page. if I want to crawl the comments of all MOOC courses on the entire website, how much useless work will be done!
However, Baidu times has no answers to Chinese content. So I went to Google and found that there were predecessors in the world who answered the question:
The main idea is to use the get_attribute method to extract innerHTML, as follows:
After verification, everything is OK:
Don't tell me that the webdriver in selenium uses driver. page_source. I just don't want to submit all the HTML documents for Soup every time. Because, for the next...