Trulia爬虫工具集

crawl_trulia的Python项目详细描述


https://travis-ci.org/MacHu-GWU/crawl_trulia-project.svg?branch=masterhttps://img.shields.io/pypi/v/crawl_trulia.svghttps://img.shields.io/pypi/l/crawl_trulia.svghttps://img.shields.io/pypi/pyversions/crawl_trulia.svg

欢迎使用Crawl_Trulia文档

这是一个小项目,提供url路由,html解析工具来抓取www.trulia.com。

用法

一个真实的例子:

>>>fromcrawl_trulia.urlencoderimporturlencoder>>>fromcrawl_trulia.htmlparserimporthtmlparser>>>fromcrawlib.spiderimportspider# install crawlib first# use address, city and zipcode>>>address="22 Yew Rd">>>city="Baltimore">>>zipcode="21221">>>url=urlencoder.by_address_city_and_zipcode(address,city,zipcode)>>>html=spider.get_html(url)>>>house_detail_data=htmlparser.get_house_detail(html)>>>house_detail_data{"features":{},"public_records":{"AC":"a/c","basement_type":"improved basement (finished)","bathroom":2,"build_year":1986,"county":"baltimore county","exterior_walls":"siding (alum/vinyl)","heating":"heat pump","lot_size":7505,"lot_size_unit":"sqft","partial_bathroom":1,"roof":"composition shingle","sqft":998}}# usually combination of address and zipcode is enough>>>address="2004 Birch Rd">>>zipcode="21221">>>url=urlencoder.by_address_and_zipcode(address,zipcode)>>>html=spider.get_html(url)>>>house_detail_data=htmlparser.get_house_detail(html)

安装

crawl_trulia在pypi上发布,所以您只需要:

$ pip install crawl_trulia

要升级到最新版本:

$ pip install --upgrade crawl_trulia

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ArrayList Java中的搜索字符串   另一个web应用程序的java访问会话   另一个应用程序中的活动和服务之间的java通信   java根据Json字符串类型将Json字符串转换为对象   eclipse如何解决java中的错误异常。lang.NoSuchMethodError:'java。字符串javax。摆动JOptionPane。showInputDialog(java.lang.String)'   线程“main”java中的安卓异常。lang.NoClassDefFoundError:org/codehaus/jackson/JsonParseException   java如何在安卓 emulator上显示Mat图像?使用NDK   Java在本地读取测试源文件,但在服务器上读取失败   java dowhile循环用于计算输入数字中的数字。故障排除代码   JAva初学者在编写获取成本的方法时遇到困难   java是shell游戏。我如何让物体移动,特别是在特定的曲线上,但顺序是随机的?   java如何区分两个同名的JButton   java为什么我在Spring Boot中需要一个接口?   java将文件路径插入数据库将删除\   使用InterfaceType初始化java对象   java如何部署一个分为Angular、Spring Boot和MySQL的项目?   java如何使用Symja解决不等式?