![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 65
zanllp
个人网站 zanllp.cn
展开
-
python 在vs2017下安装第三方模块的方法
点击python环境,在powershell中打开 输入 pip install chardet,chardet是你要安装的包名,等滚完就行了、,(我这是因为已经安装过一次了)没出现什么问题。64位按上面那种方法会报错原因就是权限不足。对于此我们用管理员权限的命令行(win+x)来操作,输入pip.exe的地址 install 你想要安装的模块,pip.exe可以在vs的python环境看到,记得...原创 2018-04-15 10:41:52 · 14844 阅读 · 9 评论 -
python thinker(菜单,滚动条,回调函数,对话框)
菜单menufrom tkinter import *root= Tk() def lab(): label0=Label(root,text="hello world") label0.grid(column=0)root.geometry("800x480")#窗口大小menu0=Menu(root)#参数是父级控件for x in ['文件','编辑','视图...原创 2018-05-04 19:33:33 · 21393 阅读 · 2 评论 -
python 爬虫 (2)BeautifulSoup&PyMySQL
from urllib import requestfrom bs4 import *html=request.urlopen("http://www.5izdh.cn")bs0=BeautifulSoup(html)title=bs0.findAll("a",{"class":"text-dark"})#等同于 .findAll(class="text-dark"),但是因为cla...原创 2018-05-19 06:38:40 · 268 阅读 · 0 评论 -
python 爬虫 (3)selenium
使用selenium前需要浏览器,这里用的phantomjs,是个无头浏览器,就是只加载到内存你看不到图形界面,当然其它浏览器opera,chrome,edge,ie,firefox都行。需要要http://pythonscraping.com/pages/javascript/ajaxDemo.html就使用了ajax技术,在打开2秒后网页的内容会改变。打开后停3秒from selenium i...原创 2018-05-19 06:55:38 · 328 阅读 · 0 评论 -
python爬虫(4)requests+lxml
selenium定时停止加载selenium默认是加载完网页才进行下一步的,有的网页要几十秒甚至分钟才加载完,但我们需要的信息基本上只要几秒就已经加载完了,使用定时停止加载可以节省大量的时间。 driver_0= webdriver.Chrome(executable_path=r"C:\chromedriver.exe",chrome_options=chrome_options)#路径前...原创 2018-05-25 15:48:41 · 1103 阅读 · 0 评论 -
基于python爬虫在WNMP运行环境下的自动化网站实现
主要原理为从百度热点排行获取实时热点,再根据百度热点的链接获取热点的信息内容并写入wordpress的数据库实现网站的自动化。在server2016+nginx+mysql5.7+php7.2+wordpress4.96下正常运行。服务器为腾讯云每个月10块的穷逼学生套餐,1c2g1m。 源码:https://github.com/zanllp/hotspot_Crawler...原创 2018-06-02 03:35:38 · 252 阅读 · 0 评论