day18——爬虫requests基础和网页作业
import requests
from re import fullmatch,findall
response = requests.get('https://cd.zu.ke.com/zufang/rtrt200600000002/')
r1=response.text
result1 = findall(r'合租\·[\w()]+\s+[\d\u4e00-\u9fa5]+\s+[\d\u4e00-\u9fa5\s]*[\u4e00-\u9fa5]+\s',r1)
# print(result1)
result2 = findall(r'整租\·[\w()]+\s+[\d\u4e00-\u9fa5]+\s+[\d\u4e00-\u9fa5\s]*[\u4e00-\u9fa5]+\s',r1)
# print(result2)
house = result1 + result2
print(house)
price = findall(r'<span class="">.*?</span>',r1)
print(price)