... <看更多>
「requests.get python」的推薦目錄:
- 關於requests.get python 在 [閒聊] 請教如何抓class下面的資訊- 看板Python - 批踢踢實業坊 的評價
- 關於requests.get python 在 Python requests GET takes a long time to respond to some ... 的評價
- 關於requests.get python 在 Python 爬蟲常用技巧(持續更新) 的評價
- 關於requests.get python 在 Python Requests | Get and Post Requests - YouTube 的評價
- 關於requests.get python 在 psf/requests: A simple, yet elegant, HTTP library. - GitHub 的評價
requests.get python 在 Python 爬蟲常用技巧(持續更新) 的推薦與評價
import requests from bs4 import BeautifulSoup response = requests.get(url) soup = BeautifulSoup(response.text, 'lxml') ... <看更多>
requests.get python 在 psf/requests: A simple, yet elegant, HTTP library. - GitHub 的推薦與評價
Installing Requests and Supported Versions. Requests is available on PyPI: $ python -m pip install requests. Requests officially supports Python 2.7 & 3.6+. ... <看更多>
requests.get python 在 [閒聊] 請教如何抓class下面的資訊- 看板Python - 批踢踢實業坊 的推薦與評價
各位大大晚安,想請教如何可以正確爬得正確資訊
[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又可以了?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.25.201.214 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1637248349.A.A66.html
※ 編輯: garlic774 (114.25.201.214 臺灣), 11/18/2021 23:20:29
... <看更多>