I'm trying to make webscraping bots that join raffles automatically. I'm having an issue with only listing an href since there are 2 in the URL.
One of them leads to a page where I can join the raffle, while the other takes me to the profile page of the person who created the raffle.
Code:
URL = 'https://scrape.tf/raffles/ending'
pagee = requests.get(URL)
Soup = BeautifulSoup(pagee.content, 'html.parser')
for link in Soup.select('a'):
print(link.get('href'))
Using the code above it prints the href for both the profile page and raffle page. What I want to do is make the code only print the href to the raffle page.
The href for profile page and raffle page are different:
profile page = /profile/(raffle creator's username)
raffle page = /raffles/######
I tried using the filter() function but it says:
TypeError: filtfunc() takes 0 positional arguments but 1 was given
When I use other codes in the filter() function it shows:
<filter object at ...........>
Is there a way to make Python only print the raffle href?