Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Trying to Scrape Yahoo Finance got an error #322

Open
siba2893 opened this issue Nov 19, 2023 · 2 comments
Open

When Trying to Scrape Yahoo Finance got an error #322

siba2893 opened this issue Nov 19, 2023 · 2 comments

Comments

@siba2893
Copy link

Step To Reproduce / Observed behavior

class YahooFinanceScrapper
  def initialize(symbol)
    @symbol = symbol
    @base_url = "https://finance.yahoo.com/quote/"
  end

  def parse
    Puppeteer.launch(headless: true) do |browser|
      page = browser.pages.first || browser.new_page
      page.viewport = Puppeteer::Viewport.new(width: 1280, height: 800)
      page.goto(@base_url + @symbol, wait_until: 'domcontentloaded')

      byebug

      h1 = page.query_selector("div#quote-header-info h1")
    end
  end
end

When running page.query_selector("div#quote-header-info h1") or page.query_selector("body") I'm getting *** RuntimeError Exception: Bug of puppeteer-ruby...

Expected behavior

Retrieve the element

Environment

Development

Paste the output of ruby --version: ruby 3.2.1

Copy link

stale bot commented Mar 17, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@thongao1302
Copy link

thongao1302 commented Apr 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants