各位大大晚安,想請教如何可以正確爬得正確資訊
[in]
import urllib.parse
import requests
import time
import json
import os
from bs4 import BeautifulSoup
url =
'https://tw.mall.yahoo.com/store/%E5%B1%88%E8%87%A3%E6%B0%8FWatsons:watsons'
USER_AGENT_VALUE = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'
headers = {'User-Agent': USER_AGENT_VALUE}
res = requests.get(url, headers=headers)
soup = BeautifulSoup(res.text, 'html.parser')
b = soup.find_all(class_='sc-hzMMVR gYfXYo')
print(b)
[out]
[]
請問為何會抓不到class下面的內容呢? 但是改用selenium.webdriver又可以了?