Eva B
Eva B

Reputation: 11

Matlab urlread button click on homepage

I try to read data from the homepage https://www.apg.at/emwebapgrem/AuctionResults.do with Matlab.

I already managed to filter the relevant type and date with the command

[str, ~] = urlread(['https://www.apg.at/emwebapgrem/AuctionResults.do?', ...
                        'auctionType=SECONDARY_CONTROL_POWER', ...
                        '&periodBegin.date=01.01.2014', ...
                        '&periodEnd.date=10.01.2014', ...
                        '&auctionOpenedFrom.date=', ...
                        '&auctionOpenedTo.date=', ...
                        '&doFilter=Filtern']);

Now I want Matlab to hit the Detail button on the homepage right next to the first auction and output the data of the first auction as a string. Any ideas how to make Matlab address the page that appears, when you hit the Detail button?

Thank you!!

Upvotes: 1

Views: 1100

Answers (2)

Eva B
Eva B

Reputation: 11

I solved it myself. This is the solution link I have to call where the number behind 'auctionReultListIndex' describes which bid in the list I want to see:

https://www.apg.at/emwebapgrem/AuctionResults.do?auctionType=SECONDARY_CONTROL_ENERGY&periodBegin.date=02.03.2015&periodEnd.date=03.03.2015&auctionOpenedFrom.date=&auctionOpenedTo.date=&doFilter=Filtern&auctionResultListIndex=0&auctionResultListAction=detail

So the Maltab code is:

[str, ~] = urlread(['https://www.apg.at/emwebapgrem/AuctionResults.do?auctionType=SECONDARY_CONTROL_ENERGY&periodBegin.date=02.03.2015&periodEnd.date=03.03.2015&auctionOpenedFrom.date=&auctionOpenedTo.date=&doFilter=Filtern&auctionResultListIndex=0&auctionResultListAction=detail']); 

Then the parameter str contains a string with the specific bid details.

Upvotes: 0

LowPolyCorgi
LowPolyCorgi

Reputation: 5189

Unfortunately, Matlab is not able to do this by itself. In your context Matlab is just a client which gets the content of an URL with urlread. There is no such thing as a urlclickhere or urldothisaction function ...

Your only option with Matlab is to build up the URL associated with the button from the information available on the main page, and then call urlread again.

If you are not bound with Matlab, Sikuli is an interesting Jython project that might be helpful here.

Upvotes: 0

Related Questions