Μάθημα : Προγραμματισμός Βπ Θεωρία

Κωδικός : 0540545254

0540545254 - ΓΕΩΡΓΙΟΣ ΜΠΑΝΤΟΥΒΕΡΗΣ

Ενότητες μαθήματος

A Practical Introduction to Web Scraping in Python

#A Practical Introduction to Web Scraping in Python https://realpython.com/python-web-scraping-practical-introduction/

import urllib

from urllib.request import urlopen
url = "http://olympus.realpython.org/profiles/aphrodite"
page = urlopen(url)
html_bytes = page.read()

html = html_bytes.decode("utf-8")
print(html)
title_arxi = html.find("<title>")+len("<title>")
print ( title_arxi)
title_telos = html.find("</title>")
print ( title_telos)
print(html[title_arxi:title_telos])