Important: we will use a real-life example in this tutorial, so you will need requests and Beautifulsoup libraries installed.
Step 1. Let’s start by importing the Beautifulsoup library.
from bs4 import BeautifulSoup
Step 2. Then, import requests library.
import requests
Step 3. Get a source code of your target landing page. We will use In-Depth Smartproxy Review & Performance Tests page in this example.
r=requests.get("https://proxyway.com/reviews/smartproxy-proxies")
An universal code might look like this:
r=requests.get("Your URL")
Step 4. Convert HTML code into a Beautifulsoup object named soup.
soup=BeautifulSoup(r.content,"html.parser")
Step 5. Then, find the href attribute you want to extract. We will be using this tag as an example:

a_href=soup.find("a",{"class":"single-intro__cta"}).get("href")
An universal code might look like this:
a_href=soup.find("a",{"class":" class of your target a element"}).get("href")
Step 6. Let’s check if our code works by printing it out.
print(a_href)
Results:
Congratulations, you’ve extracted an URL from an a element. Here’s the full script:
from bs4 import BeautifulSoup
import requests
r=requests.get("https://proxyway.com/reviews/smartproxy-proxies")
soup=BeautifulSoup(r.content,"html.parser")
a_href=soup.find("a",{"class":"single-intro__cta"}).get("href")
print(a_href)
Doesnt work
hey my cheff “get” is not working
What error are you getting? It’s working for us.
Doesnt work me too
works for me!!! how can i make this into a loop tho
the find should be replaced by find_all