Skip to content
Advertisement

Python Scraping Website urls and article numbers

Actually I want to scrape the all-child product link of these websites with the child product.

Website which I am scraping is : https://lappkorea.lappgroup.com/

My work code is :

JavaScript

This is the data which I want to scrape from the whole website :

enter image description here

When we go to any product as for the one product link is mentioned on the code. We drag down and click on the any article number and popup datasheet appers, click on it pdf will open.

I just want that Artciles numbers with their PDF links.

I have a CSV of the all parent links which I scraped, as I give one link in the script i.e: “https://lappkorea.lappgroup.com/product-introduction/online-catalogue/power-and-control-cables/various-applications/pvc-outer-sheath-and-coloured-cores/oelflex-classic-100-300500-v.html”. I want to get all the links from that CSV file which I have and scraped the all products article number and Child Product links as you did above and want to save them in one CSV file in separate columns one column is for the article number and one is for the child product links

JavaScript

Image of the CSV file :

enter image description here

Error while running on the server

enter image description here

Help me get out of this to run on the server

Advertisement

Answer

This is a scrapy spider that does what you want.

steps to reproduce:

  1. install scrapy pip install scrapy
  2. start project scrapy startproject lappkorea
  3. cd lappkorea
  4. open new file in ./lappkorea/spiders and copy and paste the following code
  5. here -> scrapy crawl lappkorea -o "zain details.csv" <- this is your output file

JavaScript

Update

If you wanted to run the spider as a script instead of using the command line you could do this instead.

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