Jump to content

Delete text


Recommended Posts

  • Moderators

Is AU3 has a function that delete text like the tag <del> in HTML?

You'll need to write something to suit your needs... StringReplace() / StringRegExpReplace() and using a blank "" value for the replacement should do what you want.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You'll need to write something to suit your needs... StringReplace() / StringRegExpReplace() and using a blank "" value for the replacement should do what you want.

I think you haven't understood me.

Watch this file: a.html

Can AU3 make text like this?

Link to comment
Share on other sites

From Welcome to Autoit 1-2-3

; Read the contents of the body of a webpage and search for a string. If the string is found, replace it 
; with a new string and write it back to the webpage.

#include <IE.au3>

$oIE = _IECreate()
_IENavigate($oIE, "http://www.autoitscript.com/")

$body = _IEBodyReadHTML($oIE)

If StringInStr($body, "automation") Then
    MsgBox(0, "Success", "The string was found")
    $newbody = StringReplace($body, "automation", "<del>This text has been deleted</del>")
    _IEBodyWriteHTML($oIE, $newbody)
Else
    MsgBox(0, "Fail", "The string was NOT found")
EndIf

Exit

Just added your text instead of mine

8)

NEWHeader1.png

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