import requests
from pyquery import PyQuery as pq
import json
import pandas as pd
from multiprocessing.pool import Pool
columns = ['title', 'msg', 'price', 'per_meter']
def get_a_page(url):
req = requests.get(url)
doc = pq(req.text)
ul = doc('.sellListContent')
divs = ul.children('.clear .info.clear').items()
count = 0
titles = []
places = []
msgs = []
prices = []
per_meters = []
for div in divs:
count += 1
title = div.children('.title a').text()
place = div.children('.address .flood .positionInfo a').text()
msg = div.children('.address .houseInfo').text()
price = div.children('.address .priceInfo .totalPrice span').text()
per_meter = div.children('.address .priceInfo .unitPrice').attr('data-price
python爬取西安二手房信息
最新推荐文章于 2022-04-12 22:52:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)