dgrant / lego-stock-checker

Check for LEGO items coming back into stock
0 stars 0 forks source link

TypeError #1

Closed blackincolor-led closed 3 years ago

blackincolor-led commented 3 years ago

I`ve got a TypeError: raise Exception('Could not find product-info.' + html) TypeError: can only concatenate str (not "bytes") to str

What is the problem?

dgrant commented 3 years ago

Just remove the html there.

Can print out soup.prettify() to look at the html... That's The real problem, it can't find what it's looking for as I'm sure LEGO has changed it's website.

blackincolor-led commented 3 years ago

Can you get the bot to work again? Or do you know another option?

dgrant commented 3 years ago

I've fixed it for me. I now get:

https://www.lego.com/en-ca/product/elf-club-house-10275 is NOT available
https://www.lego.com/en-ca/product/hogwarts-castle-71043 is available
blackincolor-led commented 3 years ago

Thank you for fixing that problem. Now it shows whether it is available or not, but then stops immediately. Unfortunately no email will be sent if the product is available. Can you fix that too?

dgrant commented 3 years ago

Yeah, the email thing I'm not sure about. It doesn't work for me either. It only works on my server where that mail command causes an email to get sent to my personal address. I have no easy answer for that right now. A simple solution might be to connect to Twilio API and send an SMS message or something.