Apr-26-2022, 08:53 PM
(This post was last modified: Apr-26-2022, 08:53 PM by MetsxxFan01.)
import urllib.request from bs4 import BeautifulSoup url = "http://py4e-data.dr-chuck.net/known_by_Fikret.html" html = urllib.request.urlopen(url).read() soup = BeautifulSoup(html, "html.parser") data = soup.find_all('a') for d in data: n = 5 while n > 0: n = n -1 print('Names', d.contents, '\n')ok so
Enter URL: http://py4e-data.dr-chuck.net/known_by_Fikret.html
Enter count: 4
Enter position: 3
Retrieving: http://py4e-data.dr-chuck.net/known_by_Fikret.html
Retrieving: http://py4e-data.dr-chuck.net/known_by_Montgomery.html
Retrieving: http://py4e-data.dr-chuck.net/known_by_Mhairade.html
Retrieving: http://py4e-data.dr-chuck.net/known_by_Butchi.html
Retrieving: http://py4e-data.dr-chuck.net/known_by_Anayah.html
i'm trying to get the python code to do this up above with the Enter URL text, i don't know how to do that, please help me