深圳租房資訊爬蟲

2022-07-27 03:27:11 字數 436 閱讀 1827

考慮到以後可能會在深圳工作,所以寫了這個爬蟲,希望對自己的找房過程提供一些便捷。

資訊**是豆瓣的深圳租房小組(想爬取其他城市只需要更換一下url就好)。

所以我提供了**篩選功能,目前設定的是2000/月。

我把它按標題,帖子鏈結,正文的順序儲存在txt檔案下,便於分享。

以下是效果圖↓

因為有些帖子的正文沒有內容,所以是空行

因為headers比較長所以我省略了一部分,比較遺憾的是不會操作pdf檔案,不然就可以把也寫進去。(中間因為請求太頻繁豆瓣還把我的賬號鎖定了0.0)

python 爬蟲抓取19樓租房資訊

chrome中開啟19lou.com,按f12可以開啟開發者工具檢視 不獲取cookie會導致爬取 時重定向而抓不到內容 headers 我們請求的url為 page 1為第一頁 迴圈標籤獲取所有子頁面的url,然後請求詳情頁獲取租房資訊和 for child in soup.table.find ...

爬蟲爬取趕集網租房資訊

如下 示例 import scrapy import numpy as np import pandas as pd import matplotlib.pyplot as plt 如下 示例 terminal 終端實現 cd 跳轉到上一層目錄 scrapy startproject booktop...

管理租房資訊

create database if not exists county 客戶資訊表 create table if not exists sys user uid int 4 not null primary key auto increment comment 客戶編號 uname varcha...