def key_operation():
# ????
options = webdriver.ChromeOptions()
options.add_argument(
'--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36')
browser = webdriver.Chrome(executable_path=r'C:\software\chrome\chromedriver.exe',
chrome_options=options) #
browser.implicitly_wait(60)
browser.get('https://m.fang.com/fangjia/sz_list_pinggu/')
#browser.send_keys(Keys.DOWN)
count=0
while count<190:
browser.find_element_by_xpath("//body[@class='whitebg']").send_keys(Keys.PAGE_DOWN)
time.sleep(5)
count=count+1
raw_input('enter')
评论列表
文章目录