MCPcopy Index your code
hub / github.com/geekcomputers/Python / crawl_html_page

Method crawl_html_page

mobilePhoneSpecsScrapper.py:23–39  ·  view source on GitHub ↗
(self, sub_url)

Source from the content-addressed store, hash-verified

21 self.absolute_path = os.getcwd().strip() + "/" + self.new_folder_name
22
23 def crawl_html_page(self, sub_url):
24 url = sub_url # Url for html content parsing.
25
26 # Handing the connection error of the url.
27 try:
28 page = requests.get(url)
29 # It parses the html data from requested url.
30 soup = BeautifulSoup(page.text, "html.parser")
31 return soup
32
33 except ConnectionError:
34 print("Please check your network connection and re-run the script.")
35 exit()
36
37 except Exception:
38 print("Please check your network connection and re-run the script.")
39 exit()
40
41 def crawl_phone_urls(self):
42 phones_urls = []

Callers 2

crawl_phone_urlsMethod · 0.95

Calls 2

exitFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected