Question: Why Am i getting this error? Please help me get the right child page links... url = http://drd,ba,ttu.edu/isqs 3358/hw/hw1/ # Define the throttle setting
Why Am i getting this error? Please help me get the right child page links...

url = "http://drd,ba,ttu.edu/isqs 3358/hw/hw1/ " \# Define the throttle setting (time interval between requests) low_throttle =1 high_throttle =2 \# Send a request to the URL response = requests get(ur1) \# Check if the request was successful if response.status_code ==200 : soup = Beautifulsoup(response.text, 'html.parser') \# Find the links to the child pages links =[a[ 'href' ] for a in soup.find_all (' a, href=True )] \# Initialize an empty list to store the data data =[] \# Loop through the links for link in links: \# Send a request to the child page child_response = requests .get ( link ) \# Check if the request was successful if child_response.status_code =200 : child soup = Beautifulsoup (child_responsild page \# Extract the data from the child page name = child_soup.find ('td', text= 'Name: ').find_next(' td ').text avg_steps = child_soup. find ('td', text='Average_Steps: '). find_next ('td'). text metric = child_soup.find (' td, text = metric: ') . find_next (td). text Here you can get help of any object by pressing Ctril+1 in front of it, either on the Editor or the Console. Help can also be shown automatically after writing a left parenthesis next to an object. You can activate this behavior in Preferences > Help. New to Spyder? Read our tutorial \# Append the data to the list data. append ( [rank, name, avg s] Apply the throttle time.sleep(low_throttle + (high_throttle - low_throttle) * (time.time() \% 1)) \# Convert the data to a Pandas dataframe \# Export the data to a CSV file 'Name', 'Average_Sleep', 'Average_Water', 'Average_Steps', 'metric']) df.to_csv('scraped_data.csv', sep=' / ', index=False) else: print("Request failed. ")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
