Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- string = input("What is the string?\n")
- URL = ('http://poe.trade/search/' + string)
- headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'}
- page = requests.get(URL, headers=headers)
- soup = BeautifulSoup(page.content, 'html.parser')
- title = soup.findAll("tbody",{"id":"item-container-0"})
- price = soup.findAll("span",{"class":"currency"})
- for container in title:
- title = container["data-name"]
- print(title)
- for container in price:
- price = container["title"]
- print(price)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement