Comments (14)
I can reproduce your issue, but do not yet have a fix for it. Thanks for reporting it.
from webtools.
Probably because the web driver that I include is too old: http://stackoverflow.com/questions/42204586/chromedriver-error-unknown-error-cannot-get-automation-extension
I will try updating it and make a new release
from webtools.
@deepcoder try the new v0.0.3 release: https://github.com/arnoudbuzing/WebUnit/releases and let me know if that works better or not.
from webtools.
It seems to be working now (see attached). I could not follow your install instructions as there was no .paclet file for v0.0.3, so I just replaced the WebUnit directory in my ~/Library/Mathematica/Applications folder with same from v0.0.3 zip file. I'm a noob, so I do not understand the MMA directory structure and paclet very well. Prior to the copy, I tried to execute your build.nb file, not sure what it did.
At this point I realized that you are providing the chromedriver binaries with your package. I have one installed in my /usr/local/bin directory, but I now see that this is not the one you launch. I also see you have upgraded to the most recent version of the chromedriver, which was the version I had install outside MMA:
dproffer@Davids-Mac-Pro-MacOSX-x86-64> ./chromedriver --version
ChromeDriver 2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b)
FYI, at one point in the chromedrivers browser I did see the following message, but not sure if this is properly reflected in my most current configuration:
StartWebSession[]
Chrome session launches with following message:
You are using an unsupported command-line flag: --ignore-certificate-errors. Stability and security will suffer.
Thanks for your work!
P.S. do you have any further example of calling your various functions? I am not well enough versed to grok some of the ways to use your package?
See picture below of successful results:
from webtools.
There should be .paclet files now here (v0.0.3 and v.0.0.4): https://github.com/arnoudbuzing/WebUnit/releases
I have added a usage.nb notebook, with the beginnings of a few examples. (Still needs a lot of work).
Thanks for using my package!
from webtools.
Was able to install 0.0.4 successfully via paclet install instructions and run my basic tests also successfully. I was not able to find a file usage.nb in either the paclet directory or in the contents of the .zip file.
from webtools.
Just found usage.nb in root of github directory for WebUnit, thanks!
from webtools.
Hi can someone please help me.
I have written the following code:
OpenWebPage["http://sqlzoo.net/"]
ClickElement[Id["n-SELECT-basics"]]
TypeElement[Id["txtar_1"], "SELECT * FROM world"]
this all works but how do i press the Submit SQL
button underneath the textbox?
from webtools.
Try:
JavascriptExecute["document.querySelector('button.submitSQL').click();"]
from webtools.
Thank you it works! Can you explain how do you arrive at the answer? I don't know Javascript and i can't find the documentation on how to use this WebUnit
package.
from webtools.
Thank you can you also tell me how do i get a signal when the page is updated after pressing the button. I have written a program which pulls the result from the website table. The problem is it sometimes pull the result before the page is updated.
from webtools.
Another option, using ClickElement directly:
ClickElement[XPath["//*[@id=\"frm__1\"]/div/button"]]
To get the xpath:
- In Chrome, open the developer tools on the page of interest.
- Select the "Elements" tab.
- Click the element selector icon (top left, the icon with an arrow pointing into a square).
- Click on the element of interest (here, the blue "Submit SQL" button)
- In the developer tools, right click on the highlighted element and click Copy > Copy XPath (submenu)
- In WebUnit, type
ClickElement[XPath[""]]
and paste the copied xpath inside the double quotes.
from webtools.
For the second question, you can use LocateElement, e.g. this returns something different before and after you click submit:
LocateElement[XPath["//*[@id=\"mw-content-text\"]/div[3]/div[2]/h1"]]
from webtools.
Thank you, is there a way to select an item from a drop down list after clicking the item with id?
from webtools.
Related Issues (12)
- Import Source HOT 2
- Get specified HTML element HOT 8
- WebUnit crash after opening certain webpages HOT 3
- Download Image using WebUnit HOT 3
- A tricky solution to Chinese directory names HOT 3
- Suggestion: verify connection to browser after InstallWebUnit[] HOT 5
- StartWebSession not working? HOT 3
- Misspelling in `QueryMethod` and `QueryValue`?
- How to catch the full cookies?
- EdgeDriver's high OS dependency HOT 10
- Starting Chrome using StartExternalSession with SessionOptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webtools.