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

    • zenocon
      By zenocon
      Hi, After scouring the forums for many hours, I'm trying to compile the most up to date / recent information on the options available for integrating with JavaScript / DOM -- as it relates to scraping + automation of web pages.
      It's my understanding there is IE.au3 script for automation of IE through a COM interface.  But I believe this only works with IE and won't work with Edge, correct?  Is there a COM interface that works with Edge, or any other options for integrating with Edge (other than IUIAuatomation?)
      I know there was also a FF.au3 UDF, but Mozilla abandoned the support for their mozrepl in favor of Web Extensions, and my understanding is that the FF.au3 UDF no longer works, is that correct?
      There was also a Chrome.au3 UDF, but my read on the forums indicate that this also broke many Chrome releases past.
      Which leaves IUIAutomation which I have been using to automate / scrape Windows apps, but when I am trying it on a website, it is not as useful.  For example, if I know the exact DOM id / class, I can get at it and do whatever I need to in JavaScript very simply.  With IUIAutomation, the DOM properties are not available, and most tags / elements in DOM have no useful defining characteristics to be able to get at them reliably (if they are targetable at all).  Some things might be able to be done with IUIAutomation, but I see it's value in targeting website automation / scraping as fairly limited.
      At this point, it seems like my best option is to use IE.au3, but that forces users on IE, which is probably a showstopper.
      Is there another way to bridge into the DOM?  I have written Web Extensions for Chrome and Firefox before.  They can communicate with external processes via AJAX or messaging.  I'm wondering if I can build what I need in a WebExtension and then trigger it from AutoIT Script, and gather up the results somewhere.
      I know there was the ISimpleDOM.au3 and some Microsoft Accessability scripts, but they seem to only be partially supported in browsers, and I didn't have a lot of luck getting those examples to run correctly.
    • rudi
      By rudi
      Hello,
      very propably this has been asked before, well, I miss the thread(s) ...
      Is there a command line switch to tell the SciTE setup EXE to install silently ("/S") *AND* to end up with "edit" (instead of "run") as system wide default action for *.au3 files?
       

       
      As it can be done with the config tool:
      https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/SciTEConfigb1.PNG
       
      Regards, Rudi.
    • 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