So, I have developed a web scraping tool to scrape data from the website, "Mercateo". The tool has many other websites integrated into it.
Since I need to scrape like 1000 products from each website, I was forced to use multithreading/Multiprocessing.
For somereason, the website wont scrape the data completely when I use multithreading. and works fine with a for loop.
I assume, It has something something to do with website making them unable to process completely while scraping the data.
example :
List3 = ['09140006153', '09140009952', '09 14 000 6152', '09 14 003 4501', ' 09 14 000 6252', '09140034501', '09 14 000 6253', '09 14 003 4501', '09140006258', '345346', '61 SBK4 PA', 'VAS17608R', '14610C C24', 'VAT11713L', 'K0737.2101X20', 'SP123231', '2746', '2591', '2748', '2592','2747', '2590', '7878', 'Z17L-UK27', ]
And when I do the same thing with Multiprocessing, It works for the first few and then randomly returns empty values :
Any idea why this is happening? It was working fine with the same code until few months back, so it certainly has something to do with the website, trying to handle all the traffic from one IP.
If you have any idea how to solve this issue, it would be really helpful, and you don't have to do it for free. :)
Since I need to scrape like 1000 products from each website, I was forced to use multithreading/Multiprocessing.
For somereason, the website wont scrape the data completely when I use multithreading. and works fine with a for loop.
I assume, It has something something to do with website making them unable to process completely while scraping the data.
example :
List3 = ['09140006153', '09140009952', '09 14 000 6152', '09 14 003 4501', ' 09 14 000 6252', '09140034501', '09 14 000 6253', '09 14 003 4501', '09140006258', '345346', '61 SBK4 PA', 'VAS17608R', '14610C C24', 'VAT11713L', 'K0737.2101X20', 'SP123231', '2746', '2591', '2748', '2592','2747', '2590', '7878', 'Z17L-UK27', ]
Code
List5 = []
for i in list3:
Lis = Main_file_Mercateo().search_in_website(str(i))
List5.append(Lis)
print(List5)And when I do the same thing with Multiprocessing, It works for the first few and then randomly returns empty values :
Code
# import multiprocessing
# if __name__ == '__main__':
# with multiprocessing.Pool() as pool:
# multiprocessing.freeze_support()
# results = pool.map(Main_file_Mercateo().search_in_website, list3)
# print(results)Any idea why this is happening? It was working fine with the same code until few months back, so it certainly has something to do with the website, trying to handle all the traffic from one IP.
If you have any idea how to solve this issue, it would be really helpful, and you don't have to do it for free. :)




![[Image: n5Mnml1G_o.png]](https://images2.imgbox.com/42/5f/n5Mnml1G_o.png)

