3

Python爬虫编程思想(61): 项目实战:抓取租房信息

 2 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/121055720
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Python爬虫编程思想(61): 项目实战:抓取租房信息

        本文会使用requests库抓取小猪网(http://sy.xiaozhu.com)在沈阳地区的租房信息,并通过Beautiful Soup库的节点选择器和方法选择器提取与房源相关的信息,然后将这些信息以JSON格式保存在houses.txt文件中,同时下载每个房源的实景图到images目录中。

        先在Chrome浏览器上打开小猪网沈阳地区的首页,网站如下:

http://sy.xiaozhu.com

        小猪网沈阳地区的首页如图1所示。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK