YusukeIwaki / puppeteer-ruby

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

When Trying to Scrape Yahoo Finance got an error #322

Open siba2893 opened 1 year ago

siba2893 commented 1 year 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 8 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 7 months ago