-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (45 loc) · 1.31 KB
/
main.py
File metadata and controls
52 lines (45 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# import requests
#
# URL = "https://realpython.github.io/fake-jobs/"
# page = requests.get(URL)
#
# print(page.text)
import requests
from bs4 import BeautifulSoup
URL = "https://realpython.github.io/fake-jobs/"
page = requests.get(URL)
print(page.text)
# soup = BeautifulSoup(page.content, "html.parser")
#
# results = soup.find(id="ResultsContainer")
#
# print(results.prettify())
# job_elements = results.find_all("div", class_="card-content")
#
# for job_element in job_elements:
# title_element = job_element.find("h2", class_="title")
# company_element = job_element.find("h3", class_="company")
# location_element = job_element.find("p", class_="location")
# print(title_element)
# print(company_element)
# print(location_element)
# # print(title_element.text.strip())
# # print(company_element.text.strip())
# # print(location_element.text.strip())
# print()
# python_jobs = results.find_all(
# "h2", string=lambda text: "python" in text.lower()
# )
#
# python_job_elements = [
# h2_element.parent.parent.parent for h2_element in python_jobs
# ]
#
# for job_element in python_job_elements:
# # -- snip --
# links = job_element.find_all("a")
# for link in links:
# link_url = link["href"]
# print(f"Apply here: {link_url}\n")
#
# print(len(python_jobs))