Home > Backend Development > PHP Tutorial > Partial HTML extraction by webdriver in selenium_PHP tutorial

Partial HTML extraction by webdriver in selenium_PHP tutorial

WBOY
Release: 2016-07-12 08:56:32
Original
1391 people have browsed it

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:

www.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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template