Sign in to follow this  
Followers 0
6105

change some part of code in loaded web page

8 posts in this topic

#1 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites



1 question. Which Browser?


My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
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]

Share this post


Link to post
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 ~/

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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 ~/

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      hello
      Greetings to all
      dears i have a big problem in the bass.dll
      e.g
      If you play an audio file using the bass.dll
      and  You changed the audio output
      Such as setting or removing headphones
      The sound output of bass.dll does not change
      Is there any solution
      If it exists, please give it to me
      Greetings and thanks in advance
      I apologize for my bad English
    • nacerbaaziz
      By nacerbaaziz
      Hi friends, I have a question, please.
      I have created a window containing a edit box
      I need to know how to change the keyboard language,
      e.g :
      if a user open the  script  it will be change the keyBord language   in window automatically into English
      I found more examples but didn't work with me .
      Note:  
       I use the windows 10 os
      Please help me .
      thanks in advance to all
      with my Greetings and my appreciation for all users and admins
    • nacerbaaziz
      By nacerbaaziz
      Hi dears
      How are you?
      I have a question, to you please.
      How do I create an edit box for numbers only and does not accept letters? using autoit
      greetings to all
      I hope you help ME
      Thanks to all in advance
    • ur
      By ur
      I have a text file whose data will be as below.
      win10x64 ~\erwin Notallowed1! "erwin Data Modeler r9.7 (32-bit)_2500.exe" SilentInstall.exe win10x64clone1 ~\erwin Notallowed1! "erwin Data Modeler r9.7 (64-bit)_2500.exe" DM64.exe win10x64clone2 ~\erwin Notallowed1! "erwin Mart Server r9.7 (32-bit).exe" SilentInstall.exe win10x64clone3 ~\erwin Notallowed1! "erwin License Server r9.7 (32-bit).exe" SilentInstall.exe Each line will have multiple values separated by space.
      If a value contains space in it, the value is surrounded by quotes.
      My task is to check how many values are there in each line.
      If the line contains 5 values, I need to replace the 4th value with the string contained in a variable.
      If it contains 4 values then also  I need to replace the 4th value followed by appending 5 th value to it as SilentInstall.exe
      If the value I am replacing contains spaces then I need to surround the new value with quotes.
       
      Any one can suggest how to do this,??
    • seppedelanghe
      By seppedelanghe
      Hi everyone,
      First of all sorry for my bad english.
      I'm trying to build a automated program/autoit that controls a web app.
      I created the script using mouseclick() , but i don't want the web browser to be visible.
      I tried ControlClick() , but the web app uses flash and the buttons/items to be clicked do not have an ID.
      I searched and visited a lott of autoit post and pages (even in german  ) , but could not find a way or get it to work.
      Any help is welcome!!!
      Thanks already
      Seppe