Skip to main content

VBA code in IDEA script

Hi Brian,I have been watching your pages for a long time and I consider them very useful. There is not much documentation about the ideascript itself.
I would like to ask if it is possible in the idea to do the same operation as in excel when parsing the html page. In Excel I'm able to do it using the ".getElementsByTagName" method but I did not find the way in the idea. I can only save the server answer to the file but not to work with the answer directly as in Excel VBA.  Using report reader is not posible RR can not read more that 1000 character on a line.
sample of VBA code:
row1 = .getElementsByTagName("table")(3).getElementsByTagName("tr")(j).getElementsByTagName("td")(1).innerText
row2 = .getElementsByTagName("table")(3).getElementsByTagName("tr")(j).getElementsByTagName("td")(2).innerText
Thank you for the help. Dave

Brian Element Fri, 10/12/2018 - 08:13

Hi Dave and welcome to the site.

I have never tried any web scraping with IDEA and I know there is no code to do this.  Do you have 10.3 and know any Python?  In 10.3 we can now create scripts in Python.  I did a google search and found this in python that seems to do what you are looking for - https://www.programcreek.com/python/example/52595/xml.dom.getElementsByTagName it might be an option for you.

For the report reader I think the 1000 character limitation is actually an Excel limitation, if you save a fixed length text file in Excel it will limit each page to 1000 characters.  I just did a test with report reader and I was able to read a file that was 2500 characters wide.  How to get around this is to import the file directly in to IDEA and then export it as a fixed lenght file, this will get around the 1000 character limiation.

Thanks

Brian

The website encountered an unexpected error. Try again later.