Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- import re
- import threading
- fp = open("board_game_academy_lists.txt", "w", encoding="utf-8")
- for page in range(1, 12):
- url = "https://www.boardgameacademia.com/category?tskp=" + str(page)
- r = requests.get(url)
- soup = BeautifulSoup(r.content, "html.parser")
- for product in soup.find_all("div", class_="productItem"):
- for title in product.find_all("div", class_="product_name"):
- print(title.text)
- fp.write(title.text + ';')
- for price in product.find_all("div", class_="product_price"):
- fp.write(price.text + ';')
- for old_price in product.find_all("div", class_="product_price_old"):
- fp.write(old_price.text)
- fp.write('\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement