While reading through WebTest documentation, I found a somehow cryptic note about webtest.http.StopableWSGIServer:
StopableWSGIServer is a WSGIServer which run in a separated thread. This allow to use tools like casperjs or selenium.
I know, what WebTest does. It is a package to simulate a web browser, with a very nice API, to test web pages.
I know, what Selenium does. It is a package that allows a programmer to actually use a real web browser to test web pages.
I use both of those tools in my codebase, only separately.
Somehow I can get my head around the thought of using WebTest with Selenium.
Could anybody please elaborate on that? Am I missing something?
My first idea, a bit vague, is to use WebTest API to access pages running inside a browser controller by Selenium. Was it the idea behind webtest-selenium package?
As a side note, webtest-selenium package seems to be in very early stage of development, since a long time. Does anybody know, is it alive?
Related
I'm trying to integrate backend code into a Wix site. Im not too picky about how I want to do this, or what language to write in (ideally, I have a locally-hosted Java code that I'd love to simply call). I wouldn't mind re-writing it in JavaScript though, or another language. But before I decide that I'm confused about my options. I can code but I'm new to the concepts like modules, APIs, & servers.
According to my research, back-end code with Wix is supposed to be easy (or at least do-able and not THAT complicated)....
From this webpage https://support.wix.com/en/article/corvid-calling-server-side-code-from-the-front-end-with-web-modules,
"Web modules are exclusive to Corvid and enable you to write functions that run server-side in the backend, and easily call them in your client-side code. With web modules you can import functions from backend into files or scripts in public, knowing they will run server-side. Corvid handles all the client-server communication required to enable this access."
And from this: https://www.sitepoint.com/what-is-wix-code/
"It’s serverless: All this added functionality comes in a serverless environment that lets you get your work done without any of the normal full-stack development headaches.
Just code and go: Wix Code has a built-in, online IDE and backend so you can just add the code you need to your page or your site, publish, and you’re live."
So, I thought they have a backend IDE where I can write backend code directly, or I could call my Java program. But, as I tried doing this and finding tutorials, it seems I can really only do this by calling a public API from the backend...?
https://youtu.be/tuu0D1izrUU
But ive also read (and someone who supposedly has done it before told me this) that Wix integrates with node.js, which is a backend version of JavaScript.
Can I use a Wix domain for a NodeJS app?
But, when I go into my Wix site I cannot find any option for using Node JS, and doing research on that gives me no useful results.
So, I'm thoroughly confused on what the capabilities are here. Can someone help me make sense of this?
Why are there no tutorials showing explicit code in the Corvid backend module? What's stopping me from simply writing my Java program there in a module? Do I really need an API endpoint to call and pass to the front end?
Is Node JS supported or not - has anyone done this before?
Also, in one link above they said everything is "serverless". But if I have to set up my own API endpoint won't I need to set up my own server??
There are basically two ways to go about this, which you seem to have already discovered.
Write your backend code in your Wix site. Indeed, the backend is built on Node.js as you can see here. Using this approach you will have to use JavaScript. As you seem to have found, you write this code in the Backend section of your site in a Web Module. Pros: you don't need to worry about managing a server and all your code is in one place.
Expose your already existing Java code as an API that your Wix site can call using the wix-fetch API. Pros: you don't need to rewrite your code.
I've no idea on how to do this and all the documentation that I could find by google did not help. A while back I was introduced to selenium through this tutorial and now that I'm more comfortable with it, I want my selenium "bot" to run on a webserver 24/7, receiving orders from me through facebook messenger (something I already did with it running on my local machine).
I tried to find answers online and was overwhelmed by the amount of information, finding nothing that is clear to understand. All the pages I've been through require me to learn about a large array of things and have been very specific about their tools. And some times I try to follow along something just to receive an error I don't understand nor is it explained on said something how to fix it.
I also asked this question on Reddit only to be downvoted without answer. I've no idea how to run selenium + chrome on a server.
Take me for the stupidest person on earth, How can I do this in the most clear steps? I'd prefer to use chrome with selenium, through python or php.
You can try it by making your chromedriver run headlessly. I was introduced to it by this tutorial. a headless browser means a web browser without a graphical user interface. Headless browsers provide automated control of a web page in an environment similar to your local browser and you can get screenshots too.
If headless browser is giving you an error which can't be resolved(like screen sharing error), then you can try aws or Google Cloud like platforms
Is there a Python front-end that supports nltk?
I am building a custom application that needs to do stemming and stopping, and related processing, on a simple words query from inside the browser. I am familiar with nltk's stem/stop functionality, but a quick google of Python front-end alternatives listed in this thread does not turn up support for nltk. I tried pypy.js from its website, entered "import nltk," and it failed.
(I plan to use CherryPy as the back-end, if it matters, to serve up the application to the browser on first contact, and process the outputs.)
Is there a front-end that works with nltk? Alternatively:
Can I add nltk support to any of these environments, and how?
Is there another library that does stemming/stopping that works with these front-ends?
Thank you!
You're probably best off using a JavaScript NLP library of which there are several, like NLPJS, although I can't judge its quality.
If you use Transcrypt in your browser you can use objects and call functions from that library without conversion.
So you can program in Python, while your library is in JS.
you can use flask to show your python in web browser. Flask is a web framework. This means flask provides you with tools, libraries and technologies that allow you to build a web application.
In your case you can use flask to get data from browser and analyse your data and then show the result in browser.
you can see a word cloud example with flask here.
I have a couple of Python 2.7 scripts I need to have them run from a webpage. I've never done this before, although I'm comfortable coding in Python and well versed in Linux, Apache, Nginx.
I see many different frameworks like the old CGI, WSGI, Django, etc.
I need some recommendations for a framework that would require not much changes on my Python code for it to run on a webpage.
It seems CGI would be fairly easy for me, but since there are many newer frameworks, I need some advices.
Thanks!
Flask is probably the most straightforward Python web framework to use. It touts itself as a micro framework, and is very, very fast to get up and running with.
If you have a relatively straightforward set of requirements, I'd highly recommend giving it a look over. You can find the "hello" world example on the project's homepage here: http://flask.pocoo.org/
Depending on your project's requirements (does it need to be highly available/resilient?), you may even be able to get by using Flask's built-in development webserver along with a process control system such as supervisord. I wouldn't recommend this for heavy or production workloads, but for something running out of production this set up would work just fine for you.
If you're looking for client side browser frameworks in Python, there are skulpt and brython.
When I was looking for a similar framework, I decided to learn leave python for a javascript framework (particularly AngularJS and Node JS) for a client side language. I personally felt that the size of community and learning resources available in those two areas were more robust, and provided greater opportunity to master the framework.
I am a basic python programmer.
I would like to change the settings of google chrome, especially the proxy and LAN settings automatically with a program.
I tried looking at the webbrowser library, but I don't think its sufficient.
I looked at the selenium library, but I do not know where to start looking for my requirements in the library, could someone provide a resource or a method on how to automate my tasks? I looked at another questions which describes a process using c#. But thats not my problem. I want the required documentation for my exact purpose.
http://seleniumhq.github.io/selenium/docs/api/py/api.html
which of these must I use?
What you need to use is the Selenium WebDriver API, with Python bindings (lots of other languages are also supported, and many frameworks are available).
Here's a good Python example, plus there's a huge number of helpful questions on this site.
Here's a good description of the ChromeDriver (the WebDriver library that automates a Chrome browser) complete with installation instructions and example Python code.
I personally recommend BrowserMob as a proxy server for Selenium. Although it's Java-based, once it's running you can control it via a REST API - I assume you want to be able to manipulate requests/responses, that kind of thing?
In any case, there are lots of proxy servers available, and the configuration to use one within your Python code is pretty standard. See this example (see also the links).