Jump to content

HTML Elements


Recommended Posts

Hi,

I'm trying to read the source code of webpage.

If it found something like "TEXT" it does one thing, if not do another.

I don't know if my code it's well written but I can't get it working.

If _IEPropertyGet($OIEE, "innertext") <> "TEXT" Then
...THE DO CODE...
Else
...THE NOT DO CODE...

What's wrong here? I'm using this to search if the word "TEXT" is browser source but It always keep doing the "...THE DO CODE..."

Another question I have.

Is to click a javascript function (based on an image)

I have the following code:

ControlClick("Name of IE Browser Text (Home Page Title)", "", "[Class:#class_name]")

There's anything wrong?

Thanks for help me :mellow:

Link to comment
Share on other sites

$sSearch = "TEXT TO SEARCH FOR"
If StringInStr(_IEPropertyGet($OIEE, "innertext"), $sSearch) Then
    ; Found...
Else
    ; Not found...
EndIf

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

But now I have a problem.

I want to start with the do code if string is not present.

Otherwise, I want to invert that code.

Something like

If $sSearch <> "Text" then
... The do code if $sSearch is diferent as the text above..
Else
... The do code if $sSearch is == as text above...

I just want to make that all to not change almost all my code. (something similar like If _IEPropertyGet($OIEE, "innertext") <> $sSearch Then...)

Omg... Never thought that invert a If State would be so difficult =S

Link to comment
Share on other sites

Did you look to see what value you are getting for _IEPropertyGet($OIEE, "innertext")? Maybe it's not what you thought it was.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Which glaring difference do you see between the two following excerpts?

if <condition> then
 [perform action for <condition> being True]
else
 [perform action for <condition> being False]
endif

vs.

if Not <condition> then
 [perform action for <condition> being False]
 else
 [perform action for <condition> being True]
 endif

And is the Not operator really that hard to figure out and find in the documentation?

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

That's working fine now.

Thanks!

It's not so difficult, but wasting more than 12 hours/day programming ASP and other languages for Siebel CRM is not very easy.

I come home and I just don't know anything xD

Now I only need to know how to click an image with javascript inside that doesn't have an ID. Only name of funcionts like #function1 and #function2

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...