摘要: selenium 为了解决requests无法直接执行JavaScript代码的问题 安装: pip3 install selenium 浏览器的驱动: ps:需要下载对应版本的浏览器 http://npm.taobao.org/mirrors/chromedriver/ 84.0.4147.105 阅读全文
posted @ 2020-08-05 16:14 江湖有梦 阅读(193) 评论(0) 推荐(0) 编辑
摘要: xpath xpath: XPath 是一门在 XML 文档中查找信息的语言 三个关键: / 从根节点选取。 // 不管位置,直接找 /@属性名 文本内容: doc=''' <html> <head> <base href='http://example.com/' /> <title>Exampl 阅读全文
posted @ 2020-08-05 16:12 江湖有梦 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 打码平台 一、申请注册 二、登录充值 三、下载对应的sdk(python的) ps:这里我用了超级鹰 #!/usr/bin/env python # coding:utf-8 import requests from hashlib import md5 class Chaojiying_Clien 阅读全文
posted @ 2020-08-05 16:11 江湖有梦 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 代理池搭建 一、直接从git上下载免费开源的代码 git clone git@github.com:jhao104/proxy_pool.git 二、打开修改配置 reids地址修改 三、启动爬虫 python proxyPool.py schedule 四、启动服务 python3 proxyPo 阅读全文
posted @ 2020-08-05 16:10 江湖有梦 阅读(213) 评论(0) 推荐(0) 编辑
摘要: bs4的使用 一、安装 pip3 install beautifulsoup4 二、使用方法 这是我们需要解析的内容 html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p id="my_p" c 阅读全文
posted @ 2020-08-05 16:09 江湖有梦 阅读(88) 评论(0) 推荐(0) 编辑
摘要: requests模块的使用 一、安装 pip3 install requests 二、使用方法 2.1 get请求 header = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, li 阅读全文
posted @ 2020-08-05 15:06 江湖有梦 阅读(247) 评论(0) 推荐(0) 编辑