#爱奇艺网址:http://v.iqiyi.com/index/resou/index.html import requests from bs4 import BeautifulSoupimport pandas as pdurl='http://v.iqiyi.com/index/resou/i ...
分类:
其他好文 时间:
2020-03-19 21:45:16
阅读次数:
68
主要使用request库和beautifulSoup库爬取今日热榜的数据。 具体代码实现: 1 import requests 2 from bs4 import BeautifulSoup 3 import time 4 import pandas 5 import re 6 7 def get_ ...
分类:
编程语言 时间:
2020-03-19 13:50:59
阅读次数:
94
我们在写爬虫构建请求的时候,不可避免地要添加请求头( headers ),一般来说,我们只要添加 user-agent 就能满足绝大部分需求了 但这并不是绝对的,有些请求单单添加一个 user-agent 是不能获取到数据的,在不知道是缺少哪个请求头参数的情况下,我一般会先把所有参数全部添加上,然后 ...
分类:
编程语言 时间:
2020-03-19 12:04:04
阅读次数:
100
General: Request URL:http://server-b.com/test.txt Referrer Policy:no-referrer-when-downgrade Request Headers: Accept:*/* Accept-Encoding:gzip, deflate ...
分类:
其他好文 时间:
2020-03-17 21:18:34
阅读次数:
89
default.conf配置 外部访问支持http和https,但是nginx内部统一把请求转换成https转发出去 nginx.conf配置 转发请求对应的header参数:underscores_in_headers on; 超时时间配置(全局): docker操作 启动Nginx命令: 反向代 ...
分类:
其他好文 时间:
2020-03-16 23:24:08
阅读次数:
75
1 import requests 2 3 4 resp = requests.get("http://httpbin.org/ip") 5 print(resp.text) 6 7 proxy = { 8 'http':'60.167.102.218:9999' 9 } 10 resp2 = re ...
分类:
其他好文 时间:
2020-03-16 21:46:31
阅读次数:
59
1 import requests 2 kw = {'wd':"中国"} 3 headers = { 4 "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ ...
分类:
其他好文 时间:
2020-03-16 21:38:01
阅读次数:
81
1、python读写csv文件 1 import csv 2 3 #读取csv文件内容方法1 4 csv_file = csv.reader(open('testdata.csv','r')) 5 next(csv_file, None) #skip the headers 6 for user i ...
分类:
编程语言 时间:
2020-03-15 19:00:36
阅读次数:
65
运行PHP项目时,一直弹出这个提示 Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warnin ...
分类:
其他好文 时间:
2020-03-15 09:15:00
阅读次数:
60