Python Forum
can you please help me with this python code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can you please help me with this python code
#1
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
Reply


Messages In This Thread
can you please help me with this python code - by MetsxxFan01 - Apr-26-2022, 08:53 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020