
import urllib.request from bs4 import BeautifulSoup def get_hmtl(url): respons = urllib.request.urlopen(url) return respons.read() def parse(html): soup = BeautifulSoup(html) table = soup.find('div', class_ = "container-fluid cols_table show_visited") projects = [] for row in table.find_all('div'): cols = row.find_all('div') header = cols.find_all('h2') projects.append({ #Записываем в словарь название 'title': [title.text for title in header[0].a.find_all('a')] }) for project in projects: print(project) def main (): parse(get_hmtl('https://www.weblancer.net/jobs/')) if __name__ == '__main__': main()
ТЫК
Вот html сайта:
ТЫК
Скачать картинки, если не прогрузятся: