1

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!!

Eva B
  • 11
  • 2
  • DDOS using matlab? ^_^ – scmg Mar 23 '15 at 17:36
  • I need to clarify the problem. I was able to build the first part of the URL with the parameters as stated above. On the result page there is a link invoking JavaScript. `onclick=auctionResultListForm.auctionResultListAction.value='detail';auctionResultListForm.auctionResultListIndex.value=0;submitForm(auctionResultListForm);` It does not change the URL but brings the actual results I need. Is there a way to invoke the JavaScript from Matlab? – Eva B Mar 24 '15 at 07:51

2 Answers2

0

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.

Ratbert
  • 5,463
  • 2
  • 18
  • 37
0

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.

Eva B
  • 11
  • 2