-2

I want to find one single link on a webpage. Ive tried using inspect element to find maybe an id I can use but I cant seem to find any(The website I am using is Amazon).

This is the page I want to scrape an item from https://www.amazon.co.uk/Logitech-Wireless-Keyboard-Windows-Connection/dp/B00CL6353A/ref=pd_rhf_dp_s_pd_crcbs_0_1/261-0759684-3501967?_encoding=UTF8&pd_rd_i=B00CL6353A&pd_rd_r=a77662a7-61cc-499d-bcb7-e6a61ff78ff6&pd_rd_w=Fj2y4&pd_rd_wg=tTH9a&pf_rd_p=e288c7fa-be1e-4d8d-af73-2fafa294c07b&pf_rd_r=PYW6HRMWVFRPSKQWF8KD&psc=1&refRID=PYW6HRMWVFRPSKQWF8KD

https://gyazo.com/ee615f22fb970d0831302240bdcc643c

https://gyazo.com/187e97281faf0e2d08c2d3f4ff89ec6e

  • 1
    Please provide source code in a pastebin alternative or send the actual page youd like to scrape, as well as what youve tried so far. Never send pictures, they don't help. – Aiyion.Prime Mar 08 '20 at 18:12
  • You really must post this as code rather than pictures. I think it's easy but I can't give you back a solution without being able to copy the code etc – Alistair Mar 08 '20 at 18:34
  • use `beautifulsoup's` select_one function and fill it such that it matches the singular link, you could make use of regular expressions, that is the best I can give from the limited information you have provided – maestro.inc Mar 08 '20 at 18:57

1 Answers1

0

It's hard to say without knowing the website html but you can search for an element class or id of one of its parents and then look for links within that using select function and the css style selection

Alistair
  • 589
  • 3
  • 11
  • https://www.amazon.co.uk/Logitech-Wireless-Keyboard-Windows-Connection/dp/B00CL6353A/ref=pd_rhf_dp_s_pd_crcbs_0_1/261-0759684-3501967?_encoding=UTF8&pd_rd_i=B00CL6353A&pd_rd_r=a77662a7-61cc-499d-bcb7-e6a61ff78ff6&pd_rd_w=Fj2y4&pd_rd_wg=tTH9a&pf_rd_p=e288c7fa-be1e-4d8d-af73-2fafa294c07b&pf_rd_r=PYW6HRMWVFRPSKQWF8KD&psc=1&refRID=PYW6HRMWVFRPSKQWF8KD – Mark Twinn Mar 08 '20 at 18:15
  • Please add this to your question with a snip of html code for the link you want and a few of it's parents – Alistair Mar 08 '20 at 18:16
  • I have tried this https://gyazo.com/187e97281faf0e2d08c2d3f4ff89ec6e – Mark Twinn Mar 08 '20 at 18:24