Browse, search, click , save?

Hello
Is there something similar to VBA: Dim myBrowser As Internet Explorer
...
myBrowser.Document.getElementById("name1_source").Click
Which allows me enter data and click
The name1_source is from the browser's source (Chrome, IE, etc). I can open a browser, but cannot enter text and cannot click

Respuestas (2)

Image Analyst
Image Analyst el 21 de En. de 2019

0 votos

Not sure what you're looking for but there are lots of user input functions, like input(), inputdlg(), menu(), listdlg(), etc. Unfortunately, and VERY SURPRISINGLY there is no convenient way to enter a matrix of numbers, like those. That is, for some reason, after decades of development, there is no easy to use griddlg() function where you can enter a matrix of numbers.
Again, I'm still not sure what kind of user input you're looking to collect.

1 comentario

Dave
Dave el 21 de En. de 2019
Thanks, I need to insert a string in the search box of a website. Basically I need to do the 3 steps below:
1) if you open your browser to Google
2) and in the search box you enter the string: rafting AND latvia AND 2011
3) Once you CLICK the search button the next page reads "About 89,900 results". I need to save that number or string to Matlab
I can do step 1 by using
link01='https://www.google.com'
[stat,h,url]=web(link01,'-browser')
But once in the website, how do I insert the char from matlab?
After inserting the text, how do I click search from matlab?
After clicking search, how do I save the result to matlab?
I know I could set the link01 with the string to search, as
link01_v2='https://www.google.com/search?q=rafting+and+latvia+and+2011'
However other sites do not have that option, so I need to be able to insert the string in the search box.

Iniciar sesión para comentar.

Sean de Wolski
Sean de Wolski el 21 de En. de 2019

0 votos

Look at webread, you don't need to open the browser to get the html output from the search. If you want a human to enter the content, give them an inputdlg and just use webread under the hood.

4 comentarios

Image Analyst
Image Analyst el 21 de En. de 2019
Sean, why is there no inputmatrixdlg() that would allow users to conveniently input data into a 2-D spreadsheet-like form? Can you put it in as a feature enhancement request? This would be better than using inputdlg and then trying to parse the data and shape it into a matrix.
Dave
Dave el 21 de En. de 2019
Thanks Sean, but in order to read I first need to implement a search. I think webread is after the search was implemented.
I am looking at webwrite,
response = webwrite(url,PostName1,PostValue1,...,PostNameN,PostValueN)
but how do I get the PostName1 ?
No humans involved pls.
Sean de Wolski
Sean de Wolski el 21 de En. de 2019
Ahh, so Google is not your target?
You'll need to look under the hood and see what the input form is doing and what values are being used. View the page source, get a look at the form action, and look at the values of the field.
Sean de Wolski
Sean de Wolski el 21 de En. de 2019
@IA, That's a fair enhancement request but it will carry more weight coming from directly from you!
Have you considered just using the variable editor (for non-MATLAB Compiler uses)?
x = zeros(4);
openvar('x')

Iniciar sesión para comentar.

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Preguntada:

el 20 de En. de 2019

Comentada:

el 21 de En. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by