TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
为什么输出是空呢?是代码哪里有问题呢?
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- import csv
- import time
- url="https://www.66rpg.com/"
- bro=webdriver.Chrome()
- bro.get(url)
- bro.find_element(By.CSS_SELECTOR,value="body > div.qsnMasks > div.cerBox > div.cerBtnBox > div.qsnClose").click()
- bro.find_element(By.CSS_SELECTOR,value="body > div.header > div > div.nav_inner > ul > li:nth-child(2) > a").click()
- list=bro.find_elements(By.CSS_SELECTOR,value="#search_result > li")
- for i in list:
- name=i.find_element(By.CSS_SELECTOR,value="dl > dd > h4 > a").text
- print(name)
复制代码
|
|