Skip to content
Advertisement

scrapy css selector returning None then finds value

So basically I am adding this portion to my code and I have no clue whats going on. This is the link i am using https://www.digikey.com/products/en?keywords=ID82C55 All in the same Process: -So my css selector returns none. -Then it finds a couple of the html elements returns some of them. -Then finds the last element.

So this is causing my program to mix match data and yields it incorrectly to my csv file. If anyone could tell me what the problem is here? Thanks.

Code

JavaScript

Output

JavaScript

Advertisement

Answer

I highly recommend you to switch to XPath expressions:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement