爬取新浪的主页面,想采集主要页面的新闻板块的主要条目 import requests from bs4 import BeautifulSoup import re html = requests.get("https://www.sina.com.cn") bsobj = BeautifulSou ...
分类:
其他好文 时间:
2019-10-27 19:09:56
阅读次数:
361
import requests import re from bs4 import BeautifulSoup url = "http://python123.io/ws/demo.html" r = requests.get(url) print(r.text) demo = r.text sou... ...
分类:
编程语言 时间:
2019-10-26 18:46:40
阅读次数:
341
课后习题 1. Brie?y describe the differences between the webbrowser, requests, BeautifulSoup, and selenium modules.Answer: The webbrowser has an open() met ...
分类:
其他好文 时间:
2019-10-26 17:11:04
阅读次数:
63
#-*- coding:utf-8 -*-import requestsimport chardetfrom bs4 import BeautifulSoup'''import tushare as tsimport pandas as pdimport pymysqlimport lxmlimpo ...
分类:
其他好文 时间:
2019-10-22 09:11:33
阅读次数:
185
好久没更新博客了。打算写一个python的爬虫系列及数据分析。falg也不能随便立,以免打脸。 python爬取内容,是过程,分析数据是结果,最终得出结论才是目的。python爬虫爬取了内容,一般都是从网页上获取,那我们从html页面中如何提取出自己想要的信息呢?那就需要解析。目前常用的有Beaut ...
分类:
编程语言 时间:
2019-10-18 19:29:16
阅读次数:
103
**因为糗事百科的URL改变,正则表达式也发生了改变,导致了网上许多的代码不能使用,所以写下了这一篇博客,希望对大家有所帮助,谢谢!** 废话不多说,直接上代码。 为了方便提取数据,我用的是beautifulsoup库和requests : response=requests.get(url) response.encoding="utf-8" # print(res... ...
分类:
其他好文 时间:
2019-10-06 13:45:24
阅读次数:
112