Issue
I want to get this number (dollar price) .
def get_auto_buy_price(self):
id = 35650 # specital number for items
url = f"https://buff.163.com/goods/{id}?from=market#tab=buying"
html = requests.get(url)
soup = BeautifulSoup(html.text, "lxml")
print(soup.find_all("div", "detail-tab-cont"))
With this code I can get where buff163 contains tables with prices but it's empty.
Solution
Because the webpage is dynamic and data is populating from external source via API. Only requests
module can grab data from API
url.
import requests
res= requests.get('https://buff.163.com/api/market/goods/buy_order?game=csgo&goods_id=35650&page_num=1&_=1657808768032').json()
for price in res['data']['items']:
print(price['price'])
Output:
1.2
1.1
1
1
1
0.8
0.1
Answered By - F.Hoque
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.