I want to get a mobile number from a website with a Python script. The website is showing those mobile numbers like this, if you aren't logged in:
0123 ...
If I'm logged in it looks like this:
123 456
This is the HTML Code from the Website when I'm logged in:
<span id="phone" class="text-bold">0123456</span>
My Code is:
from bs4 import BeautifulSoup
import requests
def crawler_2():
url = 'www.example.com'
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text)
for link in soup.find_all('span', {'class': 'text-bold'}):
number = link.string
print (number)
crawler_2()
I'm logged in with my browser , but still cant get the complete Number. In the console the output is the shortened version of the number like I'm not logged in.
Am I on the wrong track or do I need Mechanize or something?