Reputation: 107
I'm trying to use BeautifulSoup4 and Requests to scrape a xml page for data however i can't seem to print the results. I don't recieve an error but no data is printed.
import time
import requests
from bs4 import BeautifulSoup
url = "website.com?xml=1"
result = requests.get(url)
content = result.content
soup = BeautifulSoup(content, "html.parser")
steamID = soup.find_all("x")
print (y)
Upvotes: 1
Views: 1474
Reputation: 333
You should use an xml parser:
soup = BeautifulSoup(content, "xml")
Upvotes: 2