Jump to content

Search a text string and modify a web page on-the-fly


 Share

Recommended Posts

Hello everybody ! Can anyone help me with a script ? Need to do the following :

-Check if is already opend any ie  webpage and if my string is present on that page it will be modified with a new a word string for example : word "black" with word "white" !

-The autoitscript must running always and check if ie browser will be open to change again .

- if webpage refreshing or opened again or ie closed and re-open - the script must work - not stopping.

the script must work only for internet explorer !

link example : https://subscription.packtpub.com/book/application_development/9781782165781/1/ch01lvl1sec23/automating-internet-explorer-intermediate

 

Link to comment
Share on other sites

  • Developers
6 minutes ago, emil12345 said:

Can anyone help me with a script ?

Help means you have something that doesn't work yet or are you looking for somebody to code it for you? ;) 

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

2 minutes ago, Jos said:

Help means you have something that doesn't work yet or are you looking for somebody to code it for you? ;) 

Jos 

hi JOS  ! i am looking for somebody to code for me . i`m think it is easy for somebody that know autoit - i think is not more than 50 lines of code in autoit .

Link to comment
Share on other sites

  • Developers

... and why exactly do you think we should do that for you? 

Either way: These forums are here to help you with issues and is not a rent-a-coder forum, so the choice is yours: Are you going to code this yourself or not?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i have this part of code that will replace a string in webpage !

#include <IE.au3> 
$oIE = _IECreate() 
_IENavigate($oIE, "http://www.autoitscript.com/") 
$body = _IEBodyReadHTML($oIE) 
If StringInStr($body, "autoit") Then 
   MsgBox(0, "Success", "The string was found. Press enter to modify web page") 
   $newbody = StringReplace($body, "autoit", "AUTOMATION: YOUR NAME HERE, XXX!")
   _IEBodyWriteHTML($oIE, $newbody) 
Else 
   MsgBox(0, "Fail", "The string was NOT found") 
EndIf

 

this code is ok but is using IECreate() !  i need to wait for ie to open manualy not auto or check if already ie opened . can you help me to modify this code ? thank you !

Edited by Jos
added codebox
Link to comment
Share on other sites

 

24 minutes ago, emil12345 said:

this code is ok but is using IECreate()

so what is the problem, what else do you want to use ?

25 minutes ago, emil12345 said:

i need to wait for ie to open manualy not auto or check if already ie opened

check for _IEAttach in help file

27 minutes ago, emil12345 said:

can you help me to modify this code ?

I could but I won't. Open help file and learn how you could do it by yourself...

Link to comment
Share on other sites

I finished my code . how can i add a second word-StringReplace to script?

#include <IE.au3>
While(1)

$oIE = _IEAttach ("Google")

$body = _IEBodyReadHTML($oIE)
If StringInStr($body, "Gmail") Then

$newbody = StringReplace($body, "Gmail", "M U I E")
 _IEBodyWriteHTML($oIE, $newbody, $newbody1)
Else

EndIf
WEnd

Link to comment
Share on other sites

1 hour ago, Nine said:

 

so what is the problem, what else do you want to use ?

check for _IEAttach in help file

I could but I won't. Open help file and learn how you could do it by yourself...

i made myself ! but somthing is not ok .... it crash after a few min. please sombody help me now to fixing my script !

 

#include <IE.au3>
While(1)

$oIE = _IEAttach ("Google")


$body = _IEBodyReadHTML($oIE)


If StringInStr($body, "Images") Then
$newbody = StringReplace($body, "Images", "word1")
_IEBodyWriteHTML($oIE, $newbody)

EndIf

If StringInStr($body, "Gmail") Then
$newbody = StringReplace($body, "Gmail", "word2")
_IEBodyWriteHTML($oIE, $newbody)

 

EndIf
WEnd

Link to comment
Share on other sites

hi. i dont know what is wrong in my script !

 

#include <IE.au3>
While(1)

$oIE = _IEAttach ("Google")


$body = _IEBodyReadHTML($oIE)


If StringInStr($body, "Images") Then
$newbody = StringReplace($body, "Images", "word1")
_IEBodyWriteHTML($oIE, $newbody)

EndIf

If StringInStr($body, "Gmail") Then
$newbody = StringReplace($body, "Gmail", "word2")
_IEBodyWriteHTML($oIE, $newbody)

EndIf
WEnd

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

And please do not start a new thread when you still have one running with exactly the same question - threads merged

Moderation Team

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

hi. i dont know what is wrong in my script !

 

#include <IE.au3>
While(1)

$oIE = _IEAttach ("Google")


$body = _IEBodyReadHTML($oIE)


If StringInStr($body, "Images") Then
$newbody = StringReplace($body, "Images", "word1")
_IEBodyWriteHTML($oIE, $newbody)

EndIf

If StringInStr($body, "Gmail") Then
$newbody = StringReplace($body, "Gmail", "word2")
_IEBodyWriteHTML($oIE, $newbody)

EndIf
WEnd

Link to comment
Share on other sites

  • Developers

@emil12345,

Please stick to your original thread instead of opening a new one on the same subject!

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...