How can I automate Copy/Paste multiple times in a web page with Python?

OkPlankton

Well-Known Member
Joined
May 23, 2016
Messages
256
Reaction score
264
Location
Johannesburg
Hey Devs!

I have a large amount of PC Hardware Serial No's and would like to paste them in a specific website where I'm able to search and get specs back. I then need the URL (after the search is done) to be pasted in a txt file.

So:

1. Copy Serial No from a txt/csv file
2. Paste into the search bar (of that website)
3. Copy URL of returned page
4. Paste into a new txt file

*** I need to do this repetitively hundreds of times.

I'm not really a developer but I know my way around Python. A thorough guide would be appreciated but you don't have to break it right down, I'm more than happy to look at external resources if you guys could point me to them.

TIA!
 
If you post the site and an example of a fake serial number we may be able to offer simpler solutions.. There may be tricks around the problem. For example , the search bar may pass the serial number string as a parameter in the URL, making this job easy.

It may be harder as well.
 
If you post the site and an example of a fake serial number we may be able to offer simpler solutions.. There may be tricks around the problem. For example , the search bar may pass the serial number string as a parameter in the URL, making this job easy.

It may be harder as well.
Hey @retromodcoza

it's actually the Dell support website: https://www.dell.com/support/home/en-za

dell.PNG

I don't mind giving out the Service tag, I don't think there's any security risk but it ain't my **** so I just used a rando fake number for the search,

Here's the URL it returned: https://www.dell.com/support/search/en-za#q=83hdtb2&sort=relevancy&f:langFacet=[en]
 
Heres a service tag that expired a while back, so I can paste it here:
7LY6XW1

Results in this :
https://www.dell.com/support/home/e.../0-d2Fob2srSk5STVZURUQvWVZudVJKdz090/overview

0-d2Fob2srSk5STVZURUQvWVZudVJKdz090 This bit of the url changes with each tag.

However... what's interesting is that if you replace that string with the service tag :

https://www.dell.com/support/home/en-za/product-support/servicetag/7LY6XW1/overview

It works as well. Meaning you can shove a bunch of your tags into an array then loop through them to generate all the URLs and download the contents of each page using the request library?

For me , Dell sometimes produces a "challenge" page where you have to Click to continue. So you may need to use selenium or scrapy with python to click that for you. It probably won't be as easy as just downloading the contents of each page.
 
Heres a service tag that expired a while back, so I can paste it here:
7LY6XW1

Results in this :
https://www.dell.com/support/home/e.../0-d2Fob2srSk5STVZURUQvWVZudVJKdz090/overview

0-d2Fob2srSk5STVZURUQvWVZudVJKdz090 This bit of the url changes with each tag.

However... what's interesting is that if you replace that string with the service tag :

https://www.dell.com/support/home/en-za/product-support/servicetag/7LY6XW1/overview

It works as well. Meaning you can shove a bunch of your tags into an array then loop through them to generate all the URLs and download the contents of each page using the request library?

For me , Dell sometimes produces a "challenge" page where you have to Click to continue. So you may need to use selenium or scrapy with python to click that for you. It probably won't be as easy as just downloading the contents of each page.

I don't think he needs to click past the continue page. Probably just need the URL's? In which case, just take the base URL and add the existing service tag with a & in excel and copy the results.
 
Top
Sign up to the MyBroadband newsletter
X