Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, bs4
- url = "https://market.yandex.by/catalog--mobilnye-telefony/54726/list?hid=91491&lr=0&onstock=1&local-offers-first=0"
- r = requests.get(url)
- r.encoding = 'UTF8'
- b = bs4.BeautifulSoup(r.text, "html.parser")
- atitles = b.select("h3.n-snippet-cell2__title a")
- aprice = b.select("div.n-snippet-cell2__price a")
- d = {}
- for a in atitles:
- for a1 in aprice:
- d.setdefault(a.getText(), a1.getText())
- print(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement