Skip to content
Advertisement

Passing parameters from command line to script

I am writing a program to scrape the following website: https://filmstoon.in/

From it, I want to find several movies (Batman Begins, Iron Man, Expendables 3) and TV series (Game of Thrones) and to scrape the title, the host url and the meta url. I managed to do this, however, it is manually crafted for the specific titles. The code:

JavaScript

Everything works fine, however, I would like to make it so that if I write:

JavaScript

or any other title while executing the code in cmd, it would specifically find that movie/tv series and execute the script that I wrote.

So far, the only ideas I’ve had how to execute this is to scrape the entirety of the page, store it in a database (.txt file for example) and then find the content from it with $argc and $argv. Or – go to the main page and use the search function. My argument that I write in the command line would be passed to search form and then it would execute the script.

However, I can not wrap my head around how to do any of these ideas since I am quite new.

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement