from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
chromedriver = "C:\Users\xxx\Downloads\chromedriver-win32\chromedriver.exe"
options = Options()
options.add_argument("--headless") # Run in headless mode
options.add_argument("--disable-gpu")
service = Service(chromedriver)
driver = webdriver.Chrome(service=service, options=options)
url = "https://www.kickstarter.com/projects/owensrakukiln/the-laguna-clay-raku-kiln-for-owen/description"
driver.get(url)
try:
story_section = WebDriverWait(driver, 20).until(
EC.presence_of_element_located((By.CLASS_NAME, "story-content"))
)
story = story_section.text
print(story)
except Exception as e:
print(f"An error occurred: {e}")
driver.quit()
Hi everyone,
I am trying to webscrab the story section from this kickstarter campaign but I get an error “Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it’))”
Can anyone help me please with the right code? I am newbie in webscraping but I can easily webscrap information websites such as Amazon and Wikipedia for example, but I get a lot of errors whenever I try to webscrap from Kickstarter. Here is the code that I used:
Salma Salem is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.