2

I am trying to write a program in Python, so that I can use a Raspberry Pi to take hardware input and then do some IoT stuff as a result.

I'm comfortable with all the hardware stuff, and am pretty sure that I'll be able to figure out how to do Facebook posting and tweeting, but I also want to submit data into a webpage.

I don't have control of the webpage, access to the code or anything like that and it's going to be nigh-on impossible to get the access to the code so I'm relying on inspect element here to get any data which I need. I'm also not supposed to post the URL of the said webpage publicly, as it needs a login which I am not at liberty to release.

I want to interact with several features on the webpage, namely:

  • A mouse-over drop-down menu
  • A text entering field
  • A few buttons

I think that I need to do something with 'event listeners', but I'm unsure how to go about this; I have quite a lot of Python experience but not much web development knowledge.

Thanks

  • You need to login to the website to be able to see the webpage? In any case what you're probably looking for is something like selenium with phantomjs. With that you could open a webpage and fill in any forms or interact with any elements on the web page. – Jonathan Nov 22 '15 at 11:18
  • @Jonathan - selenium looks good, and I've found [this article] (http://selenium-python.readthedocs.org/index.html) about how to use it with python, but why do I need the phantomjs bit? – Archie Roques Nov 22 '15 at 11:23
  • Technically you don't need it. Selenium opens up a browser of your choice and runs all your commands. However if you don't want a live browser doing all the things you would have to use phantomjs. That way everything will be in a script and no browser will be opened. – Jonathan Nov 22 '15 at 11:26
  • But as I'm using a (headless) Raspberry Pi, I can't see that mattering - or is there some caveat I haven't spotted? – Archie Roques Nov 22 '15 at 11:41
  • Take a look at http://stackoverflow.com/questions/25027385/using-selenium-on-raspberry-pi-headless – Jonathan Nov 22 '15 at 11:49
  • Ok, I will try the suggestions in this and that post. Thank you! – Archie Roques Nov 22 '15 at 18:59

0 Answers0