Jump to content

Recommended Posts

Posted (edited)

There are a lot of rows... also with sensible data...

Here are the last rows in which there is some errors, but I can't interpret them...

it seems initially there is a sessionID, but then it disconnects:

  Quote

[1690644653.169][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "frameId": "F46A6CE7CDE5BA3471EF1AA7DD893630"

}

[1690644653.442][DEBUG]: DevTools WebSocket Event: Page.loadEventFired (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "timestamp": 2056.469381

}

[1690644653.442][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=20) (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "awaitPromise": false,

   "expression": "document.readyState",

   "returnByValue": true,

   "uniqueContextId": "-6409993933260785947.8988985567059233541"

}

[1690644653.442][DEBUG]: DevTools WebSocket Event: Page.navigatedWithinDocument (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "frameId": "BB60287079ADFB9F03A3AEBA0CF7BA60",

   "url":  [...................removed info...................]

}

[1690644653.443][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "frameId": "BB60287079ADFB9F03A3AEBA0CF7BA60"

}

[1690644653.443][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.167",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644653444808e+12,

      "url":  [...................removed info...................]

   }

}

[1690644653.443][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.168",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644653445864e+12,

      "url": "https://improving.duckduckgo.com/t/verticalopenimages?7495712&ct=IT&d=d&kl=it-it&rl=it-it&kp=-1&biaexp=b&dexp2=f&litexp=c&msvrtexp=b&pmexp=c"

   }

}

[1690644653.444][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.169",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644653446614e+12,

      "url": "https://improving.duckduckgo.com/t/iaoq_images?1393355&ss=0&sp=0&im=1&ism=0&px=0&ul=0&ct=IT&d=d&kl=it-it&rl=it-it&kp=-1&biaexp=b&dexp2=f&litexp=c&msvrtexp=b&pmexp=c"

   }

}

[1690644653.444][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.170",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644653447132e+12,

      "url": "https://improving.duckduckgo.com/t/si?7296702&b=chrome&atbi=false&ei=true&i=false&d=d&l=en_AU&p=windows&pre_atb=v388-4&ax=true&ak=false&serp_return=1&pre_va=_&pre_atbva=_&biaexp=b&dexp2=f&litexp=c&..."

   }

}

[1690644653.444][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.171",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.6906446534475142e+12,

      "url": "https://improving.duckduckgo.com/t/productmenuimpression?4438236&biaexp=b&dexp2=f&litexp=c&msvrtexp=b&pmexp=c"

   }

}

[1690644653.445][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=20) (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "result": {

      "type": "string",

      "value": "complete"

   }

}

[1690644653.713][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.173",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644653716503e+12,

      "url":  [...................removed info...................]

   }

}

[1690644654.178][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.247",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644654180629e+12,

      "url":  [...................removed info...................]

   }

}

[1690644654.595][DEBUG]: DevTools WebSocket Event: Log.entryAdded (session_id=E57E83EBC9F58B614227983532FD092C) BB60287079ADFB9F03A3AEBA0CF7BA60 {

   "entry": {

      "level": "error",

      "networkRequestId": "14940.317",

      "source": "network",

      "text": "Failed to load resource: net::ERR_BLOCKED_BY_CLIENT",

      "timestamp": 1.690644654597878e+12,

      "url":  [...................removed info...................]

    }

}

[1690644965.853][DEBUG]: DevTools WebSocket Event: Target.detachedFromTarget (session_id=) browser {

   "sessionId": "E57E83EBC9F58B614227983532FD092C",

   "targetId": "BB60287079ADFB9F03A3AEBA0CF7BA60"

}

[1690644966.947][WARNING]: Processing messages while being disconnected

[1690644966.947][WARNING]: Processing messages while being disconnected

[1690644966.947][SEVERE]: Unable to receive message from renderer

[1690644966.951][INFO]: [bfeaffeeff321af3505d3ec66b50c91b] RESPONSE InitSession ERROR disconnected: Unable to receive message from renderer

  (failed to check if window was closed: disconnected: not connected to DevTools)

  (Session info: chrome=115.0.5790.110)

[1690644966.951][DEBUG]: Log type 'driver' lost 3 entries on destruction

[1690644966.951][DEBUG]: Log type 'browser' lost 10 entries on destruction

 

Expand  

 

Edited by frank10
Posted

Ok, it must be something on certain opened tabs of the previous session, because if I leave only one tab opened on the same profile, now it works!
A bit disappointing anyway, because you can't trust an automated environment this way... to be sure you should always open a blank browser session instead of an old one...

Posted (edited)

I have also another problem:

before I loaded a JS script into chrome with this:

$scriptJS = FileRead($latestFile)
$scriptJS = StringReplace($scriptJS,'\', '\\') 
ConsoleWrite( "____myScript___" & @crlf &  $scriptJS & @crlf)
local $jqueryCommand = "jQuery('head').append(`<script id='myScriptJS'>"   &     $scriptJS   & "</script>`)"
_WD_ExecuteScript($sSession, $jqueryCommand )

with this Output:

  Quote

var loadedJS = 0

// ---------------------------------------UTILITY SECTIONS---------------------------------

const _delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

function _convertStringUnicode(str, mode= "fromUnicodeToChar"){

    // console.log("convUnicode:", str, mode)

    if (mode == "fromUnicodeToChar") {

        sUni = /\\\\u(\\d*)/g.exec(str)

[...]

 

Expand  

And it was fine.
EDIT BTW: the two initial ` inside .append are template literals in JS, not normal quotation marks...

But now when I check the script into chrome it is all in one line (so, after the first // it's all commented out) as:

  Quote

var loadedJS = 0// ---------------------------------------UTILITY SECTIONS---------------------------------const _delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));function _convertStringUnicode(str, mode= "fromUnicodeToChar"){// console.log("convUnicode:", str, mode)if (mode ==

Expand  

So, it seems it's deleting all newlines...
Any changes into _WD_ExecuteScript ? EDIT (with chrome115 problems I updated from an older WD version)
Or is it the new chromedriver 114 / chrome115 ?

Edited by frank10
Posted

checking this issue with:

  Quote

// ---------------------------------------UTILITY SECTIONS---------------------------------

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 7/30/2023 at 12:58 PM, mLipok said:

checking this issue with:

// ---------------------------------------UTILITY SECTIONS---------------------------------

Expand  

https://github.com/Danp2/au3WebDriver/issues/487

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/30/2023 at 8:28 AM, frank10 said:

But now when I check the script into chrome it is all in one line (so, after the first // it's all commented out) as:

  Quote

var loadedJS = 0// ---------------------------------------UTILITY SECTIONS---------------------------------const _delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));function _convertStringUnicode(str, mode= "fromUnicodeToChar"){// console.log("convUnicode:", str, mode)if (mode ==

Expand  

So

Expand  

please provide log from:

_WD_DebugSwitch($_WD_DEBUG_Full)
    _WD_ExecuteScript($sSession, $sJavaScript)
    _WD_DebugSwitch()

of course anonymize them if needed.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@frank10 please change in your copy of wd_core.au3:

Func __WD_EscapeString($sData, $iOption = 0)
    If BitAND($iOption, $JSON_MLREFORMAT) Then
;~      $sData = StringRegExpReplace($sData, '[\v\t]', '') ; Strip tabs and CR/LFs ; original
        $sData = StringRegExpReplace($sData, '\t', '') ; Strip tabs ; modified

and give it a try.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/30/2023 at 1:51 PM, mLipok said:

@frank10 please change in your copy of wd_core.au3:

Func __WD_EscapeString($sData, $iOption = 0)
    If BitAND($iOption, $JSON_MLREFORMAT) Then
;~      $sData = StringRegExpReplace($sData, '[\v\t]', '') ; Strip tabs and CR/LFs ; original
        $sData = StringRegExpReplace($sData, '\t', '') ; Strip tabs ; modified

and give it a try.

Expand  

Yes, now it's working. Thank you.
But you loose the correct indentation on the script loaded in the browser... not a technical problem, but it could be more pleasant to see the code as it was.
Maybe you could add an option to trim the code or leave it as is.

Posted (edited)
  On 7/30/2023 at 1:58 PM, frank10 said:

But you loose the correct indentation on the script loaded in the browser

Expand  

Do you refer to triming TABs ?
It is required because some Browser/WebDriver for internall JS processing - they don't support tabs in $sJavaScript string.
If you need to pass TAB in JS string you need to use \t

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 7/30/2023 at 2:05 PM, mLipok said:

Do you refer to triming TABs ?
It is required because some Browser/WebDriver for internall JS processing - they don't support tabs in $sJavaScript string.
If you need to pass TAB in JS string you need to use \t

Expand  

example:
 

_Example()
Func _Example()
    Local $sJavaScript = _
            "console.log('test\t1');" & @LF & _ ; supported
            "   console.log('test2');" & @LF & _ ; not supported by WebDriver/Browser so leading TAB should be stripped
            ""
    _WD_DebugSwitch($_WD_DEBUG_Full)
    _WD_ExecuteScript($sSession, $sJavaScript)
    _WD_DebugSwitch()
EndFunc   ;==>_Example

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/30/2023 at 2:12 PM, mLipok said:

example:
 

_Example()
Func _Example()
    Local $sJavaScript = _
            "console.log('test\t1');" & @LF & _ ; supported
            "   console.log('test2');" & @LF & _ ; not supported by WebDriver/Browser so leading TAB should be stripped
            ""
    _WD_DebugSwitch($_WD_DEBUG_Full)
    _WD_ExecuteScript($sSession, $sJavaScript)
    _WD_DebugSwitch()
EndFunc   ;==>_Example

 

Expand  

I insert tabs (but not hardcoded \t) when I'm coding with Code, then I save the .js file and then I reload in Autoit with

$scriptJS = FileRead($latestFile)

and inject to the browser with WD.

I always did this way and had no problem at all up to now in chrome.

Posted

It's definitely an error removing tabs, because for example I had this:

let allTotImp = 0
let totAdsUS = 0, totRoyUS = 0

And casually there was a tab instead of space in "let totAdsUS", but visually it seemed a normal space...

But it loaded as

lettotAdsUS = 0, totRoyUS = 0

giving error...

Posted (edited)

please change in your copy of wd_core.au3:

Func __WD_EscapeString($sData, $iOption = 0)
    If BitAND($iOption, $JSON_MLREFORMAT) Then
;~      $sData = StringRegExpReplace($sData, '[\v\t]', '') ; Strip tabs and CR/LFs ; original
        $sData = StringRegExpReplace($sData, '\t', ' ') ; replace tabs ; modified

and give it a try.

btw.
https://github.com/Danp2/au3WebDriver/issues/487#issuecomment-1657291194

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/31/2023 at 9:20 AM, mLipok said:

please change in your copy of wd_core.au3:

Func __WD_EscapeString($sData, $iOption = 0)
    If BitAND($iOption, $JSON_MLREFORMAT) Then
;~      $sData = StringRegExpReplace($sData, '[\v\t]', '') ; Strip tabs and CR/LFs ; original
        $sData = StringRegExpReplace($sData, '\t', ' ') ; replace tabs ; modified

and give it a try.

btw.
https://github.com/Danp2/au3WebDriver/issues/487#issuecomment-1657291194

 

Expand  

Yes, this way it's working.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...