The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Create Operator or Output with Groovy
darktemptation
Member Posts: 4 Contributor I
My Problem is quite simple:
I want to load a Webpage with Groovy in a Text-Operator (i.e. Document) and then extract certain attributes (e.g. all <li>-Texts).
Now I can fetch the HTML from a page with
Can somebody give me a hint?
I want to load a Webpage with Groovy in a Text-Operator (i.e. Document) and then extract certain attributes (e.g. all <li>-Texts).
Now I can fetch the HTML from a page with
But the Script Operator does not return anything to the output, even when I use the "return" from Groovy.
"http://rapid-i.com".toURL().text
Can somebody give me a hint?
Tagged:
0
Answers
... and "no", I do not know which one and how :-\.
I think you were getting nothing back because you were being re-directed, the following ( with the '/' on the end of the URL ) produces words of infinite beauty, wisdom, etc..etc..
But @haddock:
Even if I try your setting, the log tells me that there is nothing delivered to the Result 1 Port.
And if you like you can also take another page where you aren't redirected.
So the problem is still how to get the fetched result to the the output-port, with a data type that is known by RM.
Maybe then the question must be, how can I create an IOObject with a String/Text Attribute in Groovy (as Steffen suggest)?
This goes into the right direction, for what I looked. After a few modifications I found the way how to do it. So I just used the scripting Operator to define the macro and used the macro as parameter for the "Create Document" Operator. This is a nice solution I think.
Now there will be the next step, how to find all the "<li>" and write all in one Attribute.
a detailed description how to use the Groovy Operator and how to return things there is given in the How to Extend RapidMiner tutorial.
Greetings,
Sebastian
After a short search I found the tutorial in the Shop
http://rapid-i.com/component/page,shop.product_details/flypage,flypage.tpl/product_id,52/category_id,5/option,com_virtuemart/Itemid,180/
I guess you mean this.
But when I read there the detailed description there is written: What book do you guys talk there about? There is only a White Paper to purchase/download.
And may it be possible to get a short preview of the content, at least this White Paper costs €40 (resp. CHF 60.-), then I want to know exactly what is covered in there and maybe see an example.
Best regards
Darktemptation
this "book" is the white paper. The whitepaper has 45 pages in DIN A4, so other people would format it differently and call it a book.
Sorry, but what examples do you mean? It covers everything you need to write your own extensions. In fact we are using it internally to teach new colleges...There's everything in I know about extensions and I wrote the published ones...
Greetings,
Sebastian