Python Forum
Can urlopen be blocked by websites?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can urlopen be blocked by websites?
#1
Hi, I am trying to scrape a web site with following code. But it comes with a Timeout Error as below.

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

If I try with other websites, it works.
Wondering if sites can block urlopen?
Is there any way around?
Appreciate any help.

from urllib.request import urlopen
from bs4 import BeautifulSoup

url = "https://www.nseindia.com/option-chain"
html = urlopen(url)

soup = BeautifulSoup(html,'lxml')
type(soup)

title = soup.title
print(title)
Reply


Messages In This Thread
Can urlopen be blocked by websites? - by peterjv26 - Jul-26-2020, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Webscrapping sport betting websites KoinKoin 3 5,472 Nov-08-2023, 03:00 PM
Last Post: LoriBrown
  Web Scraping Sportsbook Websites Khuber79 17 304,131 Mar-17-2021, 12:06 AM
Last Post: Whitesox1
Thumbs Up Issue facing while scraping the data from different websites in single script. Balamani 1 2,128 Oct-20-2020, 09:56 AM
Last Post: Larz60+
  Python program to write into websites for you pythonDEV333 3 2,526 Jun-08-2020, 12:06 PM
Last Post: pythonDEV333
  prevent getting blocked maneesh7787 3 2,326 Dec-11-2019, 08:41 AM
Last Post: buran
  Scraping Websites to post on Telegram kobryan 1 2,660 Oct-19-2019, 07:03 AM
Last Post: metulburr
  Scraping Websites to post on Telegram kobryan 0 3,434 Oct-09-2019, 04:11 PM
Last Post: kobryan
  SSLCertVerificationError using urllib (urlopen) FalseFact 1 5,904 Mar-31-2019, 08:34 AM
Last Post: snippsat
  Error: module 'urllib' has no attribute 'urlopen' mitmit293 2 15,065 Jan-29-2019, 02:32 PM
Last Post: snippsat
  Scrapping .aspx websites boxingowl88 3 8,266 Oct-10-2018, 05:35 PM
Last Post: stranac

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020