Python调用Selenium爬取网页

2024-06-11阅读数:480
上一篇:Python解析Json字符串
下一篇:《深入了解Python爬虫攻防》课程已上线
# coding=utf-8
from selenium import webdriver
 
if __name__ == '__main__':
url = 'http://www.example.com'
client = webdriver.Chrome()
client.get(url)
html = client.page_source
print(html)
client.quit()