Python爬虫
Python爬虫
Purvis_U
毕业于xxxx学校.
展开
-
python爬虫_爬取豆瓣读书top500存入到excel文件
目的:学习笔记代码写的有点糟糕,还得努力,欢迎各位帮忙优化代码,嘻嘻嘻。代码:import requests,xlwt #导入相关库,xlwt库用来写入到excelfrom lxml import etreeheaders={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}workbook=xlwt.Workbook(encoding='utf-8')原创 2020-07-07 17:33:45 · 955 阅读 · 1 评论 -
python_爬虫使用pytesseract识别验证码遇到esseract-OCR esseract.exe is not installed or it‘s not in your path解决方案
刚开始使用pytesseract对图像中的验证码进行遇到下面报错:pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it’s not in your path于是按照网上教程在pytesseract.py(在python的安装目录里面可以找到,我的路径:C:\Users\Administrator\AppData\Local\Programs\Python\Python38\Lib\site-pac原创 2020-07-03 10:02:49 · 1878 阅读 · 4 评论 -
python爬虫_selenium给浏览器设置全局代理
目的:学习笔记代码:from selenium import webdriveroptions=webdriver.ChromeOptions()options.add_argument('--proxy-server=http://88.123.123.109:9999')#设置代理br=webdriver.Chrome(options=options)br.get('https://www.baidu.com')原创 2020-06-22 22:36:40 · 633 阅读 · 0 评论 -
python爬虫-selenium切换窗口(浏览器标签页)
目的:学习笔记代码:from selenium import webdriverbr=webdriver.Chrome()#启动浏览器br.get('https://www.baidu.com/')apython3=br.find_element_by_xpath('//a[contains(text(),"更多")]')link=apython3.get_attribute('href')new_window='window.open("{}")'.format(link)#js函数,此方法原创 2020-06-22 21:51:33 · 992 阅读 · 0 评论 -
python爬虫_selenium如何新建标签页
目的:学习过程中的笔记selenium如何新建标签页1.浏览器打开百度网页from selenium import webdriverbr=webdriver.Chrome()#启动浏览器br.get('https://www.baidu.com/')运行上面代码,浏览器会自动打开到下面窗口这个时候我们如果想要浏览器自动点击 更多 这个按钮并在新窗口中打开怎么办?分析页面 通过xpath 中text定位到标签位置(定位到了两个a标签)代码:from selenium import w原创 2020-06-22 21:01:34 · 3670 阅读 · 0 评论 -
python爬虫入门_3种方法爬取古诗文网站
的机房ID撒发快递刷卡结构化大两居复健科古法原创 2020-06-19 10:57:59 · 4842 阅读 · 1 评论