Python Forum
[WinError 10061] No connection could be made because the target machine actively refu
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WinError 10061] No connection could be made because the target machine actively refu
#1
""requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.python.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x039F1418>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))""


I am getting the above error, while running the below mentioned code.please help to fix this.
import requests

r=requests.get('https://www.python.org/')
print(r)
Reply
#2
r=requests.get('https://www.python.org/')
in you script, r is a structure. you need to take an element
print(r.text) or print(r.content)
use text for, well... text
content if binary
but only if:
r.status_code == 200
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I target and scrape a data-stat never5000 5 2,818 Feb-11-2022, 07:59 PM
Last Post: snippsat
  Target: Web Scraping / Web Automation vetabz 2 3,655 May-07-2017, 01:47 PM
Last Post: vetabz
  Python Selenium Document Lookup and Download Automation Error - Target Machine active Guttmann 4 5,227 Apr-18-2017, 12:13 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

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