Advertisement
aveBHS

Untitled

Jan 2nd, 2022
1,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4.  
  5. def Parse(url: str):
  6.     headers = {
  7.         "User-Agent": "Для приличия что нибудь поставь"
  8.     }
  9.     html = requests.get(urlб headers=headers).text
  10.     soup = BeautifulSoup(html, "lxml")
  11.  
  12.     people = []
  13.     for row in soup.find_all("tr"):
  14.         people.append({
  15.             "name": row.find_all("td")[0].text,
  16.             "birthday": row.find_all("td")[1].text,
  17.             "address": row.find_all("td")[2].text,
  18.         })
  19.    
  20.     return people
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement