python爬虫学习-day7 发表于 2019-03-08 丁香园大作战12345678910111213141516171819202122from selenium import webdriverimport timebs = webdriver.Chrome()bs.get("http://www.dxy.cn")time.sleep(2)bs.find_element_by_link_text('登录').click()bs.find_element_by_link_text('返回电脑登录').click()user = bs.find_element_by_name('username').send_keys('dxy_lfrcym19')password = bs.find_element_by_name('password').send_keys('daisiming830')print('登录')bs.find_element_by_xpath('//button').click()time.sleep(10)print('获取信息')elems = bs.find_element_by_css_selector(".auth")for elem in elems: auth = elem.find_element_by_tag_name("a") print(auth_text) 没能完成,只能占坑了。我要去复习了,再见!