Software Alternatives & Reviews

scrape-yahoo-finance

Jupyter Yahoo! Finance Visual Studio Code
  1. Project Jupyter exists to develop open-source software, open-standards, and services for interactive computing across dozens of programming languages. Ready to get started? Try it in your browser Install the Notebook.
    JupyterLab: JupyterLab is an interactive development environment that allows you to create and share documents containing live code, equations, visualizations, and narrative text. It's particularly well-suited for data science and research-oriented projects.

    #Data Science And Machine Learning #Data Science Tools #Data Science Notebooks 205 social mentions

  2. At Yahoo Finance, you get free stock quotes, up-to-date news, portfolio management resources, international market data, social interaction and mortgage rates that help you manage your financial life.
    From crawlbase import CrawlingAPI From bs4 import BeautifulSoup Import json Def crawl(page_url, api_token): try: # Initialize the CrawlingAPI object with the provided token api = CrawlingAPI({'token': api_token}) # Get the page content response = api.get(page_url) # Check if the request was successful if response['status_code'] != 200: print(f"Error: {response}") return {} # Scraped data scraped_data = scrape_data(response) print(f'{scraped_data}') return scraped_data except Exception as e: print(f"An error occurred during crawling: {e}") return {} Def scrape_data(response): try: # Parse the HTML content using Beautiful Soup soup = BeautifulSoup(response['body'], 'html.parser') # Extract required data title = soup.select_one('h1.svelte-ufs8hf').text if soup.select_one('h1.svelte-ufs8hf') else None price = soup.select_one('.livePrice.svelte-mgkamr').text if soup.select_one('.livePrice.svelte-mgkamr') else None change = soup.select_one('.priceChange.svelte-mgkamr').text if soup.select_one('.priceChange.svelte-mgkamr') else None closing_date = soup.select_one('span.svelte-1dnpe7s').text if soup.select_one('span.svelte-1dnpe7s') else None return {'title': title, 'price': price, 'change': change, 'closing_date': closing_date} except Exception as e: print(f"An error occurred during scraping: {e}") return {} If __name__ == "__main__": # Use the Javascript Request token from Crawlbase api_token = 'Crawlbase_Token' # List of stocks to crawl stocks = ['AAPL', 'TSLA', 'BTC-USD'] stocks_data = {'stocks': []} for stock in stocks: page_url = f'https://finance.yahoo.com/quote/{stock}' # Call the crawl function and append scraped data to the stocks_data dictionary stocks_data['stocks'].append(crawl(page_url, api_token)) # Write the scraped data to a JSON file with open('yahoo.json', 'w') as f: json.dump(stocks_data, f).

    #Finance #Trading #Investing 207 social mentions

  3. Build and debug modern web and cloud applications, by Microsoft
    Pricing:
    • Open Source
    Visual Studio Code (VS Code): Developed by Microsoft, VS Code is a lightweight yet powerful IDE with extensive support for Python development through extensions. It offers features like IntelliSense, debugging, and built-in Git integration.

    #Text Editors #IDE #Software Development 1012 social mentions

Discuss: scrape-yahoo-finance

Log in or Post with