something wrong with getting the right soup

66 views
Skip to first unread message

Rui Wang

unread,
Apr 24, 2023, 6:36:30 AM4/24/23
to beautifulsoup
r = requests.get("https://page.auctions.yahoo.co.jp/jp/auction/o1059440738")
soup = BeautifulSoup(r.text, 'html.parser')

when I run above code and get the soup, all the "<", ">" in the the second half of result turns to "&lt;" and "&gt;".

while I can get the right result on other pages of the same site, for examle:
soup = BeautifulSoup(r.text, 'html.parser')

I think this issue is caused by the apostrophe in the paragraph, but I don't know how to solve the problem and get the right result.

could anybody help me about this?

Unk

unread,
Aug 25, 2023, 12:17:10 PM8/25/23
to beautifulsoup
first install lxml package
the change the parser to "lxml"
Reply all
Reply to author
Forward
0 new messages