这里将会记录读者返回的印刷错误和改正方法。
tuple_2 = ('哈哈哈哈', '嘿嘿嘿嘿']
应改为:
tuple_2 = ('哈哈哈哈', '嘿嘿嘿嘿')
source = requests.get('https://www.baidu.com').content.deocde()
应改为
source = requests.get('https://www.baidu.com').content.decode()
输入mport lxml
应改为
输入import lxml
import lxml html
应改为
import lxml.html
selector = lxml.html.fromstring('网页源代码')
以图片为准。
collection = db1['spider']
应改为:
collection = database['spider']
collection = db.test
应改为:
collection = database.test
collection = db1['spider']
应改为:
collection = database['spider']
collection = db1['spider']
应改为:
collection = database['spider']
--proxy_host=代理IP
应改为:
--proxy-host=代理IP
device(scrollable=True).scroll.vert.forward()
应改为:
device(scrollable=True).scroll.vert.backward()
在终端输入 crontab-e
应改为:
在终端输入 crontab -e
while True:
for phone in phone_list:
if phone.is_alive():
break
else:
break
time.sleep(60)
应改为:
while True:
for phone in phone_list:
if phone.is_alive():
break
else:
break
time.sleep(60)
即最后一行应缩进一个级别,使其位于 while
循环内
爬虫中间键的作用对象是爬虫
应改为:
爬虫中间件的作用对象是爬虫