On this website, I am trying to first click on the link for each location under the header "All Planet Fitness Clubs Worldwide," beginning with "Albertville, AL."


  • 街道地址
  • 俱乐部营业时间

I am new to python, but I tried the code below to get all the links because all the locations seem to have a similarly structured url but the following finished with:
"0 exit code": a href='gyms/albertville-al'

from bs4 import BeautifulSoup
import requests

res = requests.get("").content
soup = BeautifulSoup(res, 'html.parser')

atags = soup.find_all('a', {'class':'clubs-list'})
links = [atag['href'] for atag in atags]
keywords = ['gyms']

for link in links:
    if any(keyword in link for keyword in keywords):
        print link```

Thank you for your help!