0

I've been trying to print time data from this site: clockofeidolon.com and I found that the hour, minutes and seconds are stored in "span class="big-x" tags and have tried to get the data with this

from bs4 import BeautifulSoup
from requests import Session

session = Session()
session.headers['user-agent'] = (
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
    'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/'
    '66.0.3359.181 Safari/537.36'
)

url = 'https://clockofeidolon'
response = session.get(url=url)

data = response.text
soup = BeautifulSoup(data, "html.parser")
spans = soup.find('<span class="big')
print(data)
print([span.text for span in spans])

I keep getting authentication erros though

socket.gaierror: [Errno 11001] getaddrinfo failed
2
  • https://clockofeidolon is not a valid URL.Make it https://clockofeidolon.com Commented Jul 13, 2018 at 15:33
  • Oh wow I feel dumb but thank you still! Commented Jul 13, 2018 at 15:44

2 Answers 2

1

This error is occuring because you are trying to access an URL that doesn't exist (https://clockofeidolon) or Python can't reach.

Look at this question, which explains what that error means:

"getaddrinfo failed", what does that mean?

Sign up to request clarification or add additional context in comments.

Comments

0

The host clockofeidolon did not resolve to an IP. You were probably looking for clockofeidolon.com.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.