Apr-27-2022, 10:44 PM
(This post was last modified: Apr-27-2022, 10:47 PM by MetsxxFan01.)
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.
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.