import datetime import logging import azure.functions as func from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq import pandas as pd my_url = "YOUR EBAY URL" # Change this to your search url def main(mytimer: func.TimerRequest) -> None: utc_timestamp = datetime.datetime.utcnow().replace( tzinfo=datetime.timezone.utc).isoformat() # Make the client object and read the html into a soup object uClient = uReq(my_url) page_html = uClient.read() uClient.close() page_soup = soup(page_html, 'html.parser') divs = page_soup.findAll('div',{'class':'s-item__details clearfix'}) # Extract relevant data from the soup object prices = [] for PS5 in divs: price = PS5.find('span',{'class':"s-item__price"}) price = price.text[1:] price = price.replace(',','') prices.append(price) # Clean data and save to a file for later use prices = pd.DataFrame(pd.to_numeric(prices,errors='coerce')).dropna() name = "PS5" + str(utc_timestamp) +".csv" name = "".join( x for x in name if (x.isalnum() or x in "._- ")) prices.to_csv(name) logging.info('Python timer trigger function ran at %s', utc_timestamp)