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
#3
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import requests

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

url = input('Enter URL: ')
num = int(input('Enter count: '))
pos = int(input('Enter position: '))
for tag in tags:
    html = urllib.request.urlopen(url, context=ctx).read()
    load_the_webpage_content = requests.get("http://py4e-data.dr-chuck.net/known_by_Fikret.html")
    soup = BeautifulSoup(html, 'html.parser')
    tags = soup('a')
while_loop = 5
while while_loop > 0:
    while_loop = while_loop -1
print('Retrieving: ', soup) 
I think there is something wrong with my for loop
Larz60+ write Apr-27-2022, 08:35 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use BBCode tags on future posts.
Reply


Messages In This Thread
RE: can you please help me with this python code - by MetsxxFan01 - Apr-27-2022, 10:44 PM

Forum Jump:

User Panel Messages

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