python房屋数据爬取
利用python爬取恋家网的房屋信息
话不多说,直接上代码:
import requests
from lxml import etree
import re
def fangwu():
with open(r'D:\python数据采集与可视化\fangwu.csv', 'a') as f:
f.write('地区,详细地址,联系电话,房屋状态,价格,房屋类型'+'\n')
url1 = 'http://www.ljia.net/new/p-{}.html'
原创
2021-01-03 22:22:19 ·
1522 阅读 ·
4 评论