User Tag List

Results 1 to 8 of 8

Thread: Retrieve elements from a page?

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Nov 2008
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieve elements from a page?

    So, I wanted to create an application that would download a web page and display it's elements in a separate interface...

    For instance, go to mailinator.com, automatically login to a specified acount and list all e-mail subjects in a list object.

    Is there an easy way to parse an HTML file and pick the elements I want?

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    You could parse it with an XML parser, they're mostly the same thing with a few differences.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    Check this out:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Main=18799&Number=1337 03

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Nov 2008
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    Quote Originally Posted by _LB
    You could parse it with an XML parser, they're mostly the same thing with a few differences.
    No can do...

    EasyXML outputs an error and XML Parser Object just plain crashes

    SEELE, will you convert that example to OINC? Since MOO isn't supported anymore and stuff...

    Edit: Can do, actually, it pops errors like crazy, but still parses the page... whee!

    XML Parser Object just crashes all the time, only EasyXML is usable...

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    HTML isn't based on XML, it's based on SGML. They're very similar, but you will see errors thrown all over the place when you put HTML through an XML parser. There is a variant of HTML based on XML instead, called XHTML, but it's not very common.

    SGML (and so HTML) allows implicitly closed elements, e.g. "<br>" for a line break. XML (and so XHTML) requires "<br/>", "<br>" without a closing "/" is illegal XML. To make things more fun, "<br/>" is illegal HTML. An XML parser run on HTML would interpret the text after the line break as being inside the "<br>", then throw an error about there being no close "</br>".
    For another example, "<p>text<p>text2<p>text3" in HTML represents three paragraphs (each "<p>" is implicitly closed by the next), in XML it would be interpreted as three "<p>", each inside the one before, then errors about the closing three "</p>" all being missing. If it is a validating parser and has an XHTML DTD, it will also throw errors about "<p>" not being allowed inside "<p>".

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Nov 2008
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    I'm parsing a XHTML file...

    Do you have any idea on how to approach this problem without having to write a parser from scratch?

    By the way, I have to parse the file in order to get text (like the subjects of mails) from a page, number of unread mails, things like that

  7. #7
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    Doesn't my example show how to avoid just that?

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieve elements from a page?

    Quote Originally Posted by Fimbul
    SEELE, will you convert that example to OINC? Since MOO isn't supported anymore and stuff...
    Um... no. Moo is better for connecting to the internet and getting data than OINC is at current state.
    Working as fast as I can on Fusion 3

Similar Threads

  1. Android UI Elements
    By manwich in forum Android Export Module Version 2.0
    Replies: 6
    Last Post: 21st April 2013, 03:07 AM
  2. Data elements
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th December 2012, 11:43 PM
  3. More iOS UI Elements?
    By Verbage in forum iOS Export Module Version 2.0
    Replies: 8
    Last Post: 28th March 2012, 07:46 PM
  4. DATA ELEMENTS???
    By imothep85 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th March 2012, 04:20 PM
  5. 'Data Elements'
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th December 2011, 03:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •