I'm scraping the website using ruby, and there were the following parts in the target page:
At first, I used Selenium, but to make the process lighter, I decided to read and parse the
script tag as just text.
However, this method will cause errors due to line breaks and minor changes, so I thought it would be nice if I could run the js function from the shell like this, but I couldn't find a way.
Rhino that could be used in the shell, but I didn't know how to run only the script tag part inside html.
How do I run a function in the
script tag in the local html file and output the results?
It's essentially not much different from Selenium, but it can also be achieved in Chrome's headless mode.
© 2022 OneMinuteCode. All rights reserved.