YusukeIwaki / puppeteer-ruby

A Ruby port of Puppeteer
Apache License 2.0
284 stars 41 forks source link

When Trying to Scrape Yahoo Finance got an error #322

Open siba2893 opened 10 months ago

siba2893 commented 10 months ago

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

stale[bot] commented 6 months ago

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 commented 4 months ago