from selenium import webdriver
import time
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup
import pandas as pd
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
import pandas as pd
options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
options.add_argument("--disable-gpu")
options.add_argument("--window-size=1920x1080")
options.add_argument("--disable-extensions")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
wait = WebDriverWait(driver, 10)
url = "https://www.askgamblers.com/online-casinos/reviews/casino-friday"
driver.get(url)
product=[]
soup = BeautifulSoup(driver.page_source,"lxml")
responsibles=soup.select("div#tabResponsible")
for responsible in responsibles:
t1=responsible.select_one(".icon-deposit-limit-tool+ span")
if "<span class="">Deposit Limit Tool</span>" in t1:
print("yes")
elif "<span class='strikethrough'>Deposit Limit Tool</span>" in t1:
print("no")
我希望我的输出在yes or no
,但每次他们给予我no
,如果有no line
,那么他们打印是,否则他们打印没有as you see in pic
请希望我做错了,你建议我的解决方案,这些是页面链接https://www.askgamblers.com/online-casinos/reviews/casino-friday
1条答案
按热度按时间x4shl7ld1#
完整代码
输出
希望这对你有帮助。快乐编码:)