Page not refreshing/updating on EC2 via Selenium - amazon-web-services

I am currently running a sports betting model on my Amazon EC2 Instance. The code (using the selenium library) refreshes the sports betting page every 2 minutes.
When I have the Instance open the code works completely fine, but when I close the instance and let the code run I cannot interact with the webpage https://duelbits.com/sportsbook/live/soccer.
I am specifically having trouble with this code (it just simply gets the list of matches available to bet on the website live soccer page):
WebDriverWait(driver, 3).until(EC.element_to_be_clickable(
(By.XPATH,'(//div[contains(#class,"styled__Event")])')))
It seems the website realises that it is not a real user using the website, is there anyway I can bypass this?

Related

The problem of widget isn't invoked using google assistant

Do anyone have the similar problem to control Android apps (from google codelab - fitness app) with their voice, using Google Assistant?
In my app, I tried to activate widget using google assistant (app action tool test), but google assistant doesn't give any respond. Therefore, I used the example code google gave to run, but it still has similar problem that widget isn't invoked when I use app action tool test to test the app.
Sample code google provided:
https://github.com/actions-on-google/appactions-fitness-kotlin.git
the shortcut looks like below and how :
enter image description here
Update:
After updating the new running record, the app won't respond when I want to trigger widget after the first time I can do it successfully. Do anyone have similar question or know how to solve it?
App updates running record
The widget cannot update/display the new running record
widget cannot be trigger to get new running record
I'm assuming you're talking about the codelab titled Integrate Android Widgets with Google Assistant.
I've been able to get this codelab to work - mostly.
When testing using the App Actions test tool:
Make sure you have uploaded the app to a project in the Google Play Console. You'll only need to do this once, even if you change your code.
Make sure the account you're using for Android Studio, Play Console, and Google Assistant on your device are all the same.
Make sure you've compiled the app and deployed it to your device. The easiest way to do this just to run it from Android Studio the first time.
When you create the preview, set the name and Locale.
Even tho these are listed as "optional", these make it easier to debug.
The App name should be something you know will be recognized by voice and not used by any other app. I tend to use things like "Splat" and "Bogus".
Set the locale to en-US
Click "Create Preview"
Once the preview is created, you can test the widget running by
Setting the Intent to GET_EXERCISE_OBSERVATION
Changing the value in the "name" property to something like "run". ("Climbing" will also work, but tell you that you don't have that activity logged.)
Making sure the target device is the one you're testing on.
Clicking Run App Action
And you should see the widget appear in the Assistant on the device.
You don't need to use the test tool, however. Once you have created the preview with the Test Tool, you can just test it right on the device:
Start the Assistant by long-pressing on the home button.
Saying or typing a request such as "How far have I run with Bogus" ("Bogus" being the name I've chosen this time
If you have issues with the emulator, there are some other troubleshooting steps which may be useful depending on the error message you get.
Now, I did say "mostly". I have seen issues where it will stop responding at all, either via the Test Tool or directly via the Assistant. A few things that I've done that often (but not always) help:
Delete and then create the preview again.
Remember that the Preview is only available for a few hours.
Force stop the application.
Force stop the Google Assistant.
Even if you don't see a message, check out the Troubleshooting steps for "Sorry, I couldn't find that"

Running Python from Amazon Web Service Ec2 Instance?

I was hoping I could get some direction about creating a website using AWS that will run a python script. I created an EC2 Instance running Ubuntu and made it talk with a relational database made with the same account.
In a nutshell, the site I am creating is a YouTube Library of captions. The user will input a title and AWS will retrieve links to XML documents that contains the captions to the related videos from YouTube. I would like to know where and how to run a Python script to scrape the text from these XML documents every time a user makes a request.
My research has taken me in multiple directions, but I am not sure what is best for my purpose. For example, I am trying to run a remote script from GitHub, but don't know if there's a better way to store the script?
It's my first time working with AWS so please keep explanations simple. Thanks!

Blocked at google's two-step verification

So the story goes that I had a perfectly working script for the past week or so, it would log in to google (by loading a certain firefox profile - which allowed me to skip 2 -step verification), scrape some data from the company site (which needs google login to access), save to csv and quit. This would occur hourly for analysis.
Alas, alack, the issue arose this morning where instead of logging in directly, the two-step verification is appearing, even though the script has not changed at all. I cannot program to enter username+password, because it sends a text to my phone with a verification code after this...
I'm absolutely at a loss. I thought loading the firefox profile would avoid this problem (and it did for ~ 5 days). Can you help me?
I am using Python 2.7, Selenium & Mac OSX

Saving Interactive Bokeh Chart

I have created an interactive Bokeh chart with various widgets which allow manipulation of the data. I now want to understand what is the standard way of sharing such a plot or how do I save it for sharing.
The plot is created with the curdoc method and then output to the Bokeh server using session.show().
#create current visualization using plot p and widgets inputs
curdoc().add_root(HBox(inputs, p, width=1100))
#run the session
session = push_session(curdoc())
session.show() # open the document in a browser
session.loop_until_closed() # run forever
Does the app trigger actual python code?
If not, you might consider reworking it as a non-server standalone document (using CustomJS callbacks, for instance). That would just generate a self-contained static HTML file that you could publish or send anywhere, and have it be immediately accessible.
If your app does rely on executing actual python code to do the work, then it needs to actually be running somewhere for users to interact with it. First off, I would suggest you make a real app that runs in the server, like the ones in the demo app gallery (see also Use Case Scenarios in the User's Guide). A real server app, i.e. one you run like bokeh serve myapp.py, is definitely preferred over using bokeh.client, especially for "publishing" scenarios (it will also be simpler/less code and more performant). Then, distributing the app could mean a few things:
You give them the script and they run bokeh serve app.py locally themselves
You "deploy" the app by leaving it running on a server with a URL that is accessible to users who you want to be able to see it
Depending on how much compute the app does, and how many users you expect at a given time, the second option could be as simple as running bokeh serve app.py somewhere. But if there is heavy compute or you expect a lot of traffic, you may need more sophisticated "scale out" deployments behind a load balancer. More information is in Deployment Scenarios in the User's Guide, and of course we are happy to help wth more extended discussions on the public mailing list. Finally, I should mention that in the near future, automated scalable publishing of Bokeh applications will be available as a feature on https://anaconda.org/

MTurk external website example

I am looking for a example where a fully completed web app can be embedded into amazon mechanical turk. I am working on a "game-like" activity that does not really belong to a form structure.
Here is my game/activity:
http://52.91.100.69:3030/
I would like to embed such tasks inside mechanical turk. My code accepts url parameters such as assignmentId, workerId etc (which I have found form the aws mturk docks)
For example:
http://52.91.100.69:3030/?assignmentId=23423&workerId=34&hitId=455
Basically, I am handling all the data logging etc, I plan to generate codes for users to enter upon completion of a number of tasks.
I would like to know how I cam accomplish this? Preferably in python (Boto)?
I looked at this tutorial: http://kaflurbaleen.blogspot.com/2014/06/in-which-i-battle-mturk-external-hits.html
Using this I made this boto file: https://gist.github.com/arendu/631a416e4cb17decb9dd
When I run it I dont see any errors, but I can't seem to find out whether the hit is available? I checked my aws mturk requester console (looked at manage HITs individually) but no hits are present.
What am I doing wrong?