Giter Club home page Giter Club logo

lianjiaspider's Introduction

##链家爬虫

爬取北京地区链家历年二手房成交记录。链家爬虫一文的全部代码,包括链家模拟登录代码。

###爬取数据的部分截图

Aaron Swartz

lianjiaspider's People

Contributors

lanbing510 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lianjiaspider's Issues

启动报错

Traceback (most recent call last):
File "LianJiaSpider.py", line 12, in
from bs4 import BeautifulSoup
ImportError: No module named bs4

可以爬青岛的吗

我把所有的
bj.lianjia.com
改成了
qd.lianjia.com
现在有报错,如下
`/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/mars/git/LianJiaSpider/LianJiaSpider.py
<urllib2.Request instance at 0x102cf1f38>
404
Not Found
http://qd.lianjia.com/?ticket=ST-7736156-tIILbXMnsuLyfc4PUyfx-www.lianjia.com
Date: Sun, 27 Nov 2016 10:08:06 GMT
LB_HEADER: aws-1a-lj-nginx00.ares.lianjia.com
Server: Tengine/2.2.0
Content-Length: 0
Connection: Close

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/init.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 371 of the file /Users/mars/git/LianJiaSpider/LianJiaSpider.py. To get rid of this warning, change code that looks like this:

BeautifulSoup([your markup])

to this:

BeautifulSoup([your markup], "html.parser")

markup_type=markup_type))
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bs4/init.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 774 of the file /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py. To get rid of this warning, change code that looks like this:

BeautifulSoup([your markup])

to this:

BeautifulSoup([your markup], "html.parser")

markup_type=markup_type))
timed out
爬下了 市南 区全部的小区信息
timed out
爬下了 市北 区全部的小区信息
爬下了 李沧 区全部的小区信息
爬下了 崂山 区全部的小区信息
Traceback (most recent call last):
爬下了 四方 区全部的小区信息
File "/Users/mars/git/LianJiaSpider/LianJiaSpider.py", line 377, in
done
exception_spider(db_cj)
File "/Users/mars/git/LianJiaSpider/LianJiaSpider.py", line 341, in exception_spider
excep_list=exception_read()
File "/Users/mars/git/LianJiaSpider/LianJiaSpider.py", line 326, in exception_read
f=open('log.txt','r')
IOError: [Errno 2] No such file or directory: 'log.txt'

Process finished with exit code 1`

爬取一会儿后出错

爬了两个城区后出现下列错误。同时网页打开后提示流量异常,要我做图片验证码,做完后网页浏览正常,但是爬取仍然如此。
此外,拿到的db是12K,是不是也是只有空文件? 另外这个文件使用sqlite查看吗?

/Library/Python/2.7/site-packages/beautifulsoup4-4.5.3-py2.7.egg/bs4/__init__.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 371 of the file LianJiaSpider.py. To get rid of this warning, change code that looks like this:

 BeautifulSoup([your markup])

to this:

 BeautifulSoup([your markup], "html.parser")

Traceback (most recent call last):
  File "LianJiaSpider.py", line 371, in <module>
    do_xiaoqu_spider(db_xq,region)
  File "LianJiaSpider.py", line 187, in do_xiaoqu_spider
    d="d="+soup.find('div',{'class':'page-box house-lst-page-box'}).get('page-data')
AttributeError: 'NoneType' object has no attribute 'get'

链家好像把所有的数据都加密了

现在链家的所有网页,查看source的话都放在这里了,抓不到了。

<link rel="stylesheet" href="http://static1.ljcdn.com/pc/asset/ershoufang/xiaoquDetail/index.css?_v=20160721182616">
<link rel="stylesheet" href="http://static1.ljcdn.com/dep/ueditor/themes/iframe.css?_v=20160721182616">

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.