Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Auto buy price in buff163

I want to get this number (dollar price) auto buy 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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading