PriceHero icon indicating copy to clipboard operation
PriceHero copied to clipboard

Get "None" when y try to get item price from amazon

Open kohonez opened this issue 4 years ago • 14 comments
trafficstars

import PriceHero as ph

laptop = ph.amazon("https://www.amazon.com/dp/B08FJ6ZB4V")
print(laptop)

{'name': 'GeIL Orion DDR4 RAM, 32GB (16GBx2) 3600MHz 1.35V XMP2.0, Intel/AMD Compatible, Long DIMM High Speed Desktop Memory, Hardcore Immersive Gaming/Multimedia Content Creation/Quality Live Streaming', 'price': None}

kohonez avatar Apr 05 '21 23:04 kohonez

Hi @kohonez! Cam you give me the version of PriceHero that you are using. Do this:

import PriceHero as ph
print(ph.__version__)

Thanks!

mehtaarn000 avatar Apr 06 '21 00:04 mehtaarn000

Ok, the new version (0.5.2) should fix this bug. You can update PriceHero by running: pip install --upgrade PriceHero-mehtaarn000

Let me know if you still have issues with this module.

mehtaarn000 avatar Apr 06 '21 00:04 mehtaarn000

ooops! i was trying with newegg by mistake.. still have issues with amazon :(..

import PriceHero as ph
print(ph.__version__)

laptop = ph.amazon("https://www.amazon.com/dp/B08FJ6ZB4V")
print(laptop)

OUTPUT: 0.5.2 {'name': 'GeIL Orion DDR4 RAM, 32GB (16GBx2) 3600MHz 1.35V XMP2.0, Intel/AMD Compatible, Long DIMM High Speed Desktop Memory, Hardcore Immersive Gaming/Multimedia Content Creation/Quality Live Streaming', 'price': None}

kohonez avatar Apr 06 '21 01:04 kohonez

That's really strange. When I run the code:

import PriceHero as ph
print(ph.__version__)

laptop = ph.amazon("https://www.amazon.com/dp/B08FJ6ZB4V")
print(laptop)

I get:

0.5.2 {'name': 'GeIL Orion DDR4 RAM, 32GB (16GBx2) 3600MHz 1.35V XMP2.0, Intel/AMD Compatible, Long DIMM High Speed Desktop Memory, Hardcore Immersive Gaming/Multimedia Content Creation/Quality Live Streaming', 'price': '$185.99'}

It might have to do with your OS. Can you tell me what operating system you are using?

mehtaarn000 avatar Apr 06 '21 02:04 mehtaarn000

Win7 64 bits

kohonez avatar Apr 06 '21 02:04 kohonez

let me try in a Linux box..

kohonez avatar Apr 06 '21 02:04 kohonez

image same in Ubuntu 18.04 LTS

kohonez avatar Apr 06 '21 02:04 kohonez

After fixing this module and testing on a Windows 10 machine I got the expected output on both of my computers. Upgrade your version again and try. Let me know again if any errors occur!

mehtaarn000 avatar Apr 06 '21 02:04 mehtaarn000

Same, i'd tried in local Win7/Linux machines and a VPS with different ip, it's the same error.

kohonez avatar Apr 06 '21 02:04 kohonez

Ok, I'm not really sure what's going wrong here. I'm going to try and tackle this tomorrow after getting some sleep. Thanks for notifying be about this issue though!

mehtaarn000 avatar Apr 06 '21 03:04 mehtaarn000

Is it possible you might have encountered some sort of scrape/automation blocking page from amazon?

kilianplapp avatar Apr 07 '21 11:04 kilianplapp

I cannot replicate this problem on a Windows 10 64bit PC running Python 3.9.4

kilianplapp avatar Apr 07 '21 11:04 kilianplapp

@kilianalias Meaning you get the expected output?

mehtaarn000 avatar Apr 07 '21 16:04 mehtaarn000

Yes, I get the expected output.

kilianplapp avatar Apr 07 '21 18:04 kilianplapp