返回动态html,使用硒返回动态页面的html代码
我想抓取這個網(wǎng)站,問題是它的動態(tài)加載。使用硒返回動態(tài)頁面的html代碼
基本上我想要什么,我可以從瀏覽器控制臺中看到的,不是我所看到的,當我點擊右鍵>節(jié)目源。
我已經(jīng)嘗試了一些硒的例子,但我不能讓我的需要。下面的代碼使用硒,并得到只有你點擊右鍵 - >顯示代碼。我如何獲取加載頁面的內(nèi)容?
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium import webdriver
import time
# Start the WebDriver and load the page
wd = webdriver.Firefox()
wd.get("https://www.leforem.be/particuliers/offres-emploi-recherche-par-criteres.html?exParfullText=&exPar_search_=true& exParGeographyEdi=true")
# Wait for the dynamically loaded elements to show up
time.sleep(5)
# And grab the page HTML source
html_page = wd.page_source
wd.quit()
# Now you can use html_page as you like
print(html_page)
2015-06-17
dkx22
總結
以上是生活随笔為你收集整理的返回动态html,使用硒返回动态页面的html代码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 藏青色在html页面怎么写,Html页面
- 下一篇: 小学文凭有计算机知识,重大版小学信息技术