Jump to content

change some part of code in loaded web page


6105
 Share

Recommended Posts

Hi,

Somebody can help to find solution to ignore some part of html and css code?

in example.css we have this part:

div#page {
display: block !important;
text-align: left !important;
width: 960px !important;        //<<--  How to ignore this code in loaded page with _IENavigate ($oIE, "http://www.example.com")
margin: 0 auto !important;
}

also in example.com/index.html code we have this part:

<td valign="top" align="center" style="padding-top: 0px; padding-left:10px;">
<iframe src="http://www.game-advertising-online.com/index.php?section=serve&id=321&output=html" name="iframe" width="170" height="620" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>
 
</td>

how to remove this part of code?

Thank you.

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

IE

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

You could try loading the page, getting the html of the document with _IEDocReadHTML, parsing it for certain html/CSS tags and replacing or deleting them, then rewriting the html with _IEDocWriteHTML. Although, if the CSS is in a seperate file, i dont know if this approach will work.

There's no place like ~/

Link to comment
Share on other sites

Here is a fun example:

#include <IE.au3>
$IE=_IECreate("http://en.wikipedia.org/wiki/Newbie")
_IELoadWait($IE)
$doc=_IEDocReadHTML($IE)
$doc2=StringRegExpReplace($doc,"Newbie","AutoIT")
$doc3=StringRegExpReplace($doc,"Noob","AutoIT")
$doc2=StringRegExpReplace($doc3,"noob","AutoIT")
$doc3=StringRegExpReplace($doc2,"newbie","AutoIT")
$doc2=StringRegExpReplace($doc3,"the","AutoIt")
$doc3=StringRegExpReplace($doc2,"e","AutoIT")
$doc2=StringRegExpReplace($doc3,"for","AutoIT")
_IEDocWriteHTML($IE,$doc2)

The help file is a very usefull thing :mellow:

Edited by mv2112

There's no place like ~/

Link to comment
Share on other sites

Ohh.. thank you so mutch for this example)

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

  • 2 weeks later...

Here is a fun example:

#include <IE.au3>
$IE=_IECreate("http://en.wikipedia.org/wiki/Newbie")
_IELoadWait($IE)
$doc=_IEDocReadHTML($IE)
$doc2=StringRegExpReplace($doc,"Newbie","AutoIT")
$doc3=StringRegExpReplace($doc,"Noob","AutoIT")
$doc2=StringRegExpReplace($doc3,"noob","AutoIT")
$doc3=StringRegExpReplace($doc2,"newbie","AutoIT")
$doc2=StringRegExpReplace($doc3,"the","AutoIt")
$doc3=StringRegExpReplace($doc2,"e","AutoIT")
$doc2=StringRegExpReplace($doc3,"for","AutoIT")
_IEDocWriteHTML($IE,$doc2)

The help file is a very usefull thing :graduated:

My page does not work corectly in this case.

Somebody know how chrome modify the webcontent? or firebug? or greasemonkey?

Maybe we have some solution in autoit3 too?

Does AutoIT have another metod to change the content of webpage?

or just to ignore some lines??

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Link to comment
Share on other sites

  • 5 months later...

I just want to update my question..

#include <IE.au3>
$IE=_IECreate("http://en.wikipedia.org/wiki/Newbie")
_IELoadWait($IE)
$doc=_IEDocReadHTML($IE)
$doc2=StringRegExpReplace($doc,"Newbie","AutoIT")
$doc3=StringRegExpReplace($doc,"Noob","AutoIT")
$doc2=StringRegExpReplace($doc3,"noob","AutoIT")
$doc3=StringRegExpReplace($doc2,"newbie","AutoIT")
$doc2=StringRegExpReplace($doc3,"the","AutoIt")
$doc3=StringRegExpReplace($doc2,"e","AutoIT")
$doc2=StringRegExpReplace($doc3,"for","AutoIT")
_IEDocWriteHTML($IE,$doc2)

This code don't work so well for all site coz all values what are valid in _IECreate, are not more valid in _IEDocWriteHTML.

I have tried to find some possibility like Chromium Expect Elements, or Firefox Firebug to change content in real-time..

but no successful tries. In any case i'll update this topic when will find something.

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

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

×
×
  • Create New...