How to connect to a website with Bash?
The web page is www.something.com. The command script would be in a file bar.txt: The main command would then be lynx www.something.com -accept_all_cookies -cmd_script=bar.txt Now all you need to do is dynamically create the input string.
What can I use to log in to a website?
It depends on how the website is set up. If it’s using basic HTTP authentication you may be able to use wget or curl and supply the username and password via command line arguments. If the login info is submitted via a form you can append it to the URL or add it to the post data.
How to do an interactive session in Bash?
If you want to do an interactive session in bash (i.e. getting the user to input username and password into the bash script) then you will find very useful (eg. read -e -p “My prompt: ” varname; echo $varname). It depends on how the website is set up.
How to access a website from the command line?
If what you want to do is retrieve content from a website using HTTP Basic authentication then you can achieve this from the command line using wget or curl: If cookie-based authentication is used you may be able to use wget for this too, depending on how it is set up.
How to fill a field in Bash shell?
I’m a total shell noob If you know exactly which field you need to fill, then this can be done using lynx. Assume you get the string S with your script as an input argument. Then you create a command script, which will guide lynx through its behaviour. For example, suppose S=foo, and your field is the second field in the web page.
How to write a script to connect to a website?
I want to write a script that takes an argument which is text, opens a connection to a specific website and input the arg into text field using the field’s ID. Is this possible? How would I do this? I’m a total shell noob If you know exactly which field you need to fill, then this can be done using lynx.