As I said in the title, I'm scraping some information on Letterboxd and need help.
I already have a function where I can scrape all info that I need (such as name, date, cast etc) from a URL like this https://letterboxd.com/film/when-marnie-was-there/
The point is that I also want to scrape all the movies I've already watched (which you can find here https://letterboxd.com/gfac/films/diary/) and after that use their URL to run my other function.
But looking into the devtools on my browser I can't find the complete movie URL in my diary. So I was thinking if I can extract one of the two pieces of info highlighted in the screenshot. If yes, I can after concatenate
"https://letterboxd.com/" + "film/when-marnie-was-there/"
and run my other function.
This is what I got until now:
def teste(url):
r = requests.get(url)
soup = BeautifulSoup(r.content, "html.parser")
elem = soup.find_all("h3", {"class": "headline-3 prettify"})[0]
return elem
a = teste("https://letterboxd.com/gfac/films/diary/")
print(a)
<h3 class="headline-3 prettify"><a href="/gfac/film/when-marnie-was-there/">When Marnie Was There</a></h3>