Jump to content
Sign in to follow this  
ghprog

Html/css programming

Recommended Posts

ghprog

Hello folks,

I am trying to help my friend who wants to do some html/css programming but both of us are stumped by a problem.

What my friend wants to do is access the text in some class attributes. There are a number of HTML pages where he would like to get the text and put it into a database. But the thing is, we don't know how to set things up or how to refer to the variables.

Take the example below, if he wants to get at street-address, how does he access the content of that ??

Does he use something like somevariable = .street-address ?? Where somevariable is defined as a string variable in his program ? How should he assign a variable that contains that text ?

Is there an API or library when working with those kinds of things ? How do we set up AutoIt when doing this type of work ?

Hopefully someone here can get us headed in the right direction. I spent a whole bunch of time on the web trying to find a decent example of how to do this but all I got were out of context examples (mostly definitions) that weren't helpful at all.

Thanks for any help you can give !

Here is the code example---------------

<div class="vcard">

<div class="adr">

<span class="type">Work</span>:

<div class="street-address">169 University Avenue</div>

<span class="locality">Palo Alto</span>,

<abbr class="region" title="California">CA</abbr>

<span class="postal-code">94301</span>

<div class="country-name">USA</div>

</div>

<div class="tel">

<span class="type">Work</span> +1-123-123-1234

</div>

<div class="tel">

<span class="type">Fax</span> +1-123-123-1235

</div>

<div>Email:

<span class="email">info@bla_bla.net</span>

</div>

</div>

Share this post


Link to post
Share on other sites
Xenobiologist

Just a little start

#include <Array.au3>
$str = '<div class="vcard">' & @CRLF & _
        '<div class="adr">' & @CRLF & _
        '<span class="type">Work</span>:' & @CRLF & _
        '<div class="street-address">169 University Avenue</div>' & @CRLF & _
        '<span class="locality">Palo Alto</span>,' & @CRLF & _
        '<abbr class="region" title="California">CA</abbr>' & @CRLF & _
        '<span class="postal-code">94301</span>' & @CRLF & _
        '<div class="country-name">USA</div>' & @CRLF & _
        '</div>' & @CRLF & _
        '<div class="tel">' & @CRLF & _
        '<span class="type">Work</span> +1-123-123-1234' & @CRLF & _
        '</div>' & @CRLF & _
        '<div class="tel">' & @CRLF & _
        '<span class="type">Fax</span> +1-123-123-1235' & @CRLF & _
        '</div>' & @CRLF & _
        '<div>Email:' & @CRLF & _
        '<span class="email">info@bla_bla.net</span>' & @CRLF & _
        '</div>' & @CRLF & _
        '</div>'
ConsoleWrite(StringStripCR(StringReplace($str, @LF, '')) & @CRLF)
$re = StringRegExp(StringStripCR(StringReplace($str, @LF, '')) , '>([\w \.\@\:\-\+]+)<', 3)
_ArrayDisplay($re)

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
BrettF

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×