Answer the question
In order to leave comments, you need to log in
How to make it so that when trying to parse, python does not output an empty string?
When trying to parse the initial price in steam, the python outputs an empty string
import requests
import lxml.html
def parse(url):
api = requests.get(url)
tree = lxml.html.document_fromstring(api.text)
text_original = tree.xpath('//*[@id="market_commodity_forsale"]/span[2]')
print(text_original)
parse('https://steamcommunity.com/market/listings/730/Shattered%20Web%20Case')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question