I'm trying to scrape links off of Amazon. I ran into a tiny problem.
I wish to add a particular string 'a' to every string in a list.
links = soup.find_all("a", attrs= {"class":"a-link-normal a-text-normal"})
urls = [item.get('href') for item in links]
print(urls)
The output is :
['/Redragon-KUMARA-Backlit-Mechanical-Keyboard/dp/B016MAK38U?dchild=1', '/MOTOSPEED-Professional-Mechanical-Keyboard-Illuminated/dp/B07P9J5CBJ?dchild=1', '/Mechanical-Keyboard-Keyboards-Detachable-Programmable/dp/B07QS6MG8B?dchild=1', '/Element-Mechanical-81-Replaceable-Rainbow/dp/B07DYPJWD4?dchild=1', '/DURGOD-Mechanical-Keyboard-Connector-Typists/dp/B07B8DS585?dchild=1']
Now how do I add a = https://amazon.com.au in front of every string in the list output?
I want the output to be as follows:
['https://amazon.com.au/Redragon-KUMARA-Backlit-Mechanical-Keyboard/dp/B016MAK38U?dchild=1', 'https://amazon.com.au/MOTOSPEED-Professional-Mechanical-Keyboard-Illuminated/dp/B07P9J5CBJ?dchild=1', 'https://amazon.com.au/Mechanical-Keyboard-Keyboards-Detachable-Programmable/dp/B07QS6MG8B?dchild=1', 'https://amazon.com.au/Element-Mechanical-81-Replaceable-Rainbow/dp/B07DYPJWD4?dchild=1', 'https://amazon.com.au/DURGOD-Mechanical-Keyboard-Connector-Typists/dp/B07B8DS585?dchild=1']
I'm a newbie (1.5 months into python), so apologise in advance if I'm not clear enough.
Thank you!