[Python爬虫] :Selenium +phantomjs 利用 pyquery抓取脚本链接对应的内容
抓取上面对应链接的网页的文章的内容
ele = element.attr("onclick") self.driver.execute_script(ele) sub_selenium = self.driver.execute_script("return document.documentElement.outerHTML") sub_doc = pq(sub_selenium) subE = sub_doc("div[id='SetContent']").find("p") for se in subE.items(): print(se.text())