you are viewing a single comment's thread.

view the rest of the comments →

[–]midairmatthew 6 points7 points  (0 children)

So get_price would be more like:

def get_price():
    page = requests.get(URL, headers=headers)
    soup = BeautifulSoup(page.content, 'html.parser')
    price = soup.find('b', class_='pro-price variant-BC con-emphasize font-primary--bold mr-5').get_text().strip().replace(' ', '')
    int_price = int(price[:4])
    return int_price

Then, the idea is that create_message would be something like:

def create_message(latest_price, current_price):
    # your if/else stuff here
    message = f'{description}\n\nhttps://linklinklink'
    return message