python
import requests from bs4 import BeautifulSoup import sqlite3 conn = sqlite3.connect( " test.db " ) c = conn.cursor() for num in range(1,101 ): url = " https://cs.lianjia.com/ershoufang/pg%s/ " % num headers = { ' User-Agent ' : ' Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)Chrome/64.0.3282.140 Safari/537.36 ' , } req = requests.session() response = req.get(url, headers=headers, verify= False) info = response.text f1 = BeautifulSoup(info, ' lxml ' ) f2 = f1.find(class_= ' sellListContent ' ) f3 = f2.find_all(class_= ' clear LOGCLICKDATA ' ) for i in f3: data_id =