![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python爬虫
零源
这个作者很懒,什么都没留下…
展开
-
Python爬虫-谷歌无可视化反检测
from selenium import webdriver# 实现无可视化界面from selenium.webdriver.chrome.options import Options# 实现规避检测from selenium.webdriver import ChromeOptions# 实现无可视化界面的操作chrome_options = Options()chrome_options.add_argument('--headless')chrome_options.add...原创 2022-05-20 09:49:45 · 209 阅读 · 0 评论 -
Python爬虫-模拟登入-selenium模块
selenium模块-浏览器自动化1.编写基于浏览器自动化的操作代码- 发起请求:get(url)- 标签定位:find系列的方法- 标签交互:send_keys('xxx')- 执行js程序:excute_script('jsCode')- 前进,后退:back(),forward()- 关闭浏览器:quit()2.selenium处理iframe- 如果定位的标签存在于iframe标签之中,则必须使用switch_to.frame(id)- 动作链(拖动):from ..原创 2022-05-16 22:04:20 · 170 阅读 · 0 评论 -
Python爬虫练习-Xpath解析批量爬取PPT
批量爬取PPT,分页爬取import osimport requestsfrom lxml import etreeif __name__ == '__main__': # UA伪装 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.70 Safari/537.36'原创 2022-05-08 18:52:26 · 624 阅读 · 0 评论 -
Python爬虫练习-Xpath解析图片爬取
import osimport requestsfrom lxml import etreeif __name__ == '__main__': # UA伪装 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.70 Safari/537.36' } # 指.原创 2022-05-08 16:09:25 · 512 阅读 · 0 评论