0

I will need to test few things from my linux server. I wonder if it is possible to manipulate some actions on web without access to browser. I have only access to linux server via command line. I know only selenium webdriver to do that actions but but for that I need browser. What I want to do: 1) Input text to textbox on webpage using python script which is placed on linux server 2) Click button on webpage Generally it is possible to manipulate actions on webpage from linux using python scripts?

pyton17
  • 55
  • 10
  • 1
    You don't need browser for using selenium, see https://stackoverflow.com/questions/7593611/selenium-testing-without-browser – ᴀʀᴍᴀɴ May 15 '18 at 06:48

2 Answers2

0

If you input text to fom on webpage and submit the form, the browser will send POST or GET request to the server with contained information. The server then proceses (for example saves ) the information. You dont need a browser to send http request, you can send them directly from python.

AN example can be found here: How to simulate HTTP post request using Python Requests module?

Dominik Brno
  • 116
  • 5
0

If requests module isn't enough already, try using selenium with PhantomJS. PhantomJS is a headless WebKit scriptable with a JavaScript API.

PhantomJS : http://phantomjs.org

A great tutorial : https://realpython.com/headless-selenium-testing-with-python-and-phantomjs/

Vipin Joshi
  • 305
  • 5
  • 18