How to extract data from website using python

I have just started learning python. So any help will be really appreciated. I need to scrape data from a website from a page that contains contact details of different companies. http://www.gspma.org/searchdirectory.php?page=1& if you go to this site they have many pages with company lists and when you click on a company you go to another page with its contact details. I need to scrape all the details of all the companies in the list and get them into a table. I have already installed different web scraping packages like selenium, beatifulsoup, scrapy. Tried some codes but wasn't able to get through. Please help me out Thanks in advance

I have written this code:

import requests
from bs4 import BeautifulSoup
import time
url = 'http://www.gspma.org/searchdirectory.php?page=1&'
page = ''
while page == '':
    try:
        page = requests.get(url)
        break
    except:
        print("Connection refused by the server..")
        print("Let me sleep for 5 seconds")
        print("ZZzzzz...")
        time.sleep(5)
        print("Was a nice sleep, now let me continue...")
        continue
soup = BeautifulSoup(page.content, 'lxml' )
print(soup.prettify())
l = [] #get the names of the companies
for i in soup.select("a[hreflang*=en]"):
 l.append(i.text)
import pandas as pd
names = pd.DataFrame({'col':l})  # convert the above list to a dataframe

Python just keeps on printing the above messages.