
python爬虫
文章平均质量分 78
河南骏
搬砖大阳
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
链家二手房爬虫
最近在看模拟登陆,找链家二手房爬取来练手,因为技术有限,有些并行化,复杂度,性能方面等不能兼顾, 学习学习学习。下面贴出源码,有志同道合的高手可以帮忙改进或者提些意见。#--*-- coding:utf-8 --*-- import pandas import requests import re from bs4 import BeautifulSoup from fake_useragent...原创 2018-04-18 17:12:22 · 1336 阅读 · 0 评论 -
天猫爬虫第一例
# coding:utf-8 import requests import json import simplejson import time if __name__=="__main__": headers={ 'Connection':'keep-alive', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1;Win64;x...原创 2018-04-13 15:34:35 · 1136 阅读 · 1 评论 -
初探豆瓣爬虫
# coding:utf-8-bom #写爬虫防止被封的关键有以下几点: # 1、伪装请求报头(request header) # 2、减轻访问频率,速度 # 3、使用代理IP #下面从国内高匿代理IP 获得代理IP数据 import os import time import requests from bs4 import BeautifulSoup import csv impor...原创 2018-04-13 15:35:53 · 820 阅读 · 0 评论 -
Selenium 库学习笔记
#--*-- coding:utf-8 --*-- #selenium基本使用 # from selenium import webdriver # from selenium.webdriver.common.by import By # from selenium.webdriver.support import expected_conditions as EC # from seleni...原创 2018-04-24 14:40:40 · 533 阅读 · 0 评论 -
Requests库笔记
1、概览1.1、实例引入# 引入Requests库import requests# 发起GET请求response = requests.get('https://www.baidu.com/')# 查看响应类型 requests.models.Responseprint(type(response))# 输出状态码print(response.status_code)# 输出响应内容类型 t...原创 2018-04-24 14:55:34 · 370 阅读 · 0 评论 -
BeautifulSoup 笔记
BeautifulSoup的基本使用from bs4 import BeautifulSouphtml = """<html><head><title>The Dormouse's story</title></head><body><p class="title" name=&原创 2018-04-24 15:03:28 · 426 阅读 · 0 评论 -
PyQuery笔记
1、初始化1.1、字符串初始化from pyquery import PyQuery as pyhtml = '''<div> <ul> <li class="item-0">first item</li> <li class="item-1"><a href="htt原创 2018-04-24 15:11:51 · 435 阅读 · 0 评论 -
selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH
使用selenium+phantomjs的时候,出现了这样的报错信息:selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH1下面给出解决方法:browser = webdriver.PhantomJS(executable_path=r'c:\user\y...原创 2018-04-24 17:12:04 · 1829 阅读 · 0 评论 -
腾讯动漫爬虫与动态随机加载反爬
在学习了selenium后,就想试试爬一爬动漫,在微信社区里又看到一个腾讯动漫爬虫与动态随机加载反爬破解实战的文章,就试着跑了一下,还可以。用到了PhantomJS自动触发漫画图片以及js(window.scrollTo()实现页面滑动,自动触发触剩下的多张漫画图片),最后用urllib提取并保存本地。话不多说,上代码,重点已做注释:#--*-- coding:utf-8 --*-- from s...原创 2018-04-24 18:08:21 · 1729 阅读 · 0 评论