diff --git a/timer_function.py b/timer_function.py index 9b1c80c..dd71272 100644 --- a/timer_function.py +++ b/timer_function.py @@ -7,7 +7,7 @@ from bs4 import BeautifulSoup as soup from urllib.request import urlopen as uReq import pandas as pd -my_url = "YOUR_EBAY_LINK" # Change this to your ebay search url +my_url = "YOUR EBAY URL" # Change this to your search url def main(mytimer: func.TimerRequest) -> None: utc_timestamp = datetime.datetime.utcnow().replace( @@ -21,7 +21,6 @@ def main(mytimer: func.TimerRequest) -> None: 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 = [] @@ -34,7 +33,7 @@ def main(mytimer: func.TimerRequest) -> None: # Clean data and save to a file for later use - prices = pd.DataFrame(pd.to_numeric(prices)) + 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)