logo
down
shadow

pageFunction in Puppeteer returns empty object


pageFunction in Puppeteer returns empty object

By : Vicky Thomason
Date : November 19 2020, 03:01 PM
will help you I didn't understand that the pageFunction function is running within Chromium itself, so in the second example where it is returning elem => elem, it's actually returning a live NodeList collection to Puppeteer.
But returning a live NodeList collection from Chromium back to puppeteer isn't possible because the way Puppeteer passes data to and from Chromium has to be serializable via JSON.stringify / JSON.parse. When Puppeteer runs JSON.stringify on a live NodeList, I believe it returns an empty object.
code :


Share : facebook icon twitter icon
PageFunction OnReturn and the Default PageFunction Constructor

PageFunction OnReturn and the Default PageFunction Constructor


By : ketan panghal
Date : March 29 2020, 07:55 AM
To fix the issue you can do Since posting my question I discovered that if I set KeepAlive = True on the first PageFunction it solves my problem above
Static class method returns object when called outside of classes, but returns empty object when called inside of differ

Static class method returns object when called outside of classes, but returns empty object when called inside of differ


By : W. Mosquera
Date : March 29 2020, 07:55 AM
Query selector with puppeteer returns empty array

Query selector with puppeteer returns empty array


By : user2882197
Date : March 29 2020, 07:55 AM
may help you . When the page first loads, it shows a "Loading" text and redirects/loads data from there.
You have to wait for the element to be present in the DOM. Here is what the code might look,
code :
await page.goto('https://marketingplatform.google.com/about/partners/find-a-partner');
await page.waitFor('div.landscape h3.title'); // <-- add this line
when map function is in the code it returns undefined and when console.log it returns the an empty object and an the dat

when map function is in the code it returns undefined and when console.log it returns the an empty object and an the dat


By : user3631039
Date : March 29 2020, 07:55 AM
To fix the issue you can do , Try like this:
code :
let [nasaDa, setData] = useState(null); 

    function fetchData() { //fetch function to get the data from the server
        fetch('/done')
        .then(response => response.json())
        .then(data => {
            setData(data) // Prints result from `response.json()` in getRequest
        })
        .catch(error => console.error(error)) //console.log if there is an error with fetching data 
    }

 useEffect(() => {
     fetchData();   //calling the fetch function 
 }, [])

 return(
     <div className="slide" >
         {nasaDa && nasaDa.map((item, index) => { //mapping the data that should be returned from nasaDa
             return <div key={index} className='mapDiv'>
                     <h>{item.name}</h>, 
                     <img src={item.img}/>, //mapping out the data from array 
                     <p>{item.des}</p>
            </div>
         })}
     </div>
 )
Puppeteer returning empty object

Puppeteer returning empty object


By : Siva Sanjay
Date : March 29 2020, 07:55 AM
I hope this helps you . puppeteer can transfer two types of data between Node.js and browser context: serializable data (i.e. data that is supported by JSON.stringify()/JSON.parse()) and JavaScript object ids (including DOM elements) — JSHandle and ElementHandle. Later ones have a bit more complicated API (see JSHandle and ElementHandle methods or methods that mention them).
page.evaluate() can only transfer serializable data, and instead of un-serializable data, it returns undefined or empty objects. DOM elements are non-serializable as they contain circular references and methods.
Related Posts Related Posts :
  • Integration Testing with Kitchen CI
  • Can't seem to get the from <asp:Literal </asp:Literal> property in Web forms
  • Can't access faraday params on views
  • RQM testNG integration
  • How can I enable unit templates?
  • Displaying multiple colors on a single data bar
  • Loading aggregates on reacting to domain events
  • Integrating Azure Cognitive services with Robotic Process Automation
  • Autodesk Forge Design Automation quota
  • Why can i not login to the wso2 api store using the email address of a secondary user store account
  • order not working with sortWhitelist
  • config.site for vendor libs on Fedora x86_64
  • Getting a limit response from Loopback, when no authentication is provided
  • What is the effect of FeedOptions.EnableLowPrecisionOrderBy Property
  • Recordset Null Value not being detected in null check
  • How to connect to an arbitary database using FaaS?
  • SourceTree not working after Windows 10 Fall Creators Update
  • How to get all registered user from Openfire through http
  • Error "invalid parameter" when launching a converted app
  • Using react-sortable-hoc with react-virtualized Grid
  • Xamarin.Forms: How to set values in Style only on specific platform
  • ZSH avoid adding empty commands to history?
  • Grep regular expression - Pattern issue
  • Unable to connect via Java to a DSE graph
  • Check if attachment is up to date with current document revision in couchdb
  • Can I bind an argument value ahead of time when using redux-actions?
  • How to change a member field with Kotlin reflection?
  • Replaying merged streams individually
  • DevExpress GridColumn strange proportional sizing
  • Drools Decision table error : Error while creating KieBase
  • Kafka-Flink-Stream processing: Is there a way to reload input files into the variables being used in a streaming process
  • How to export and import nifi flow from one HDP to another HDP
  • map pointWidth to a single Datapoint in Column Chart
  • Pygame animating image by transforming it
  • Why is my Gdk/cairo class causing a segfault?
  • How to organize queues in Masstransit/RabbitMQ?
  • How to remove a collection element without EntityManager#remove(...) in Doctrine 2?
  • how to change the format of the return value of 'mnist.load_data()' to 'mnist_train.csv' in Keras?
  • CodeFights Interview Practice- Dynamic Programing : Basic : fillingBlocks
  • Accessing the built request details in Karate
  • How to draw a polyline with initial point in Leaflet
  • docusign transform pdf field with text tab as required
  • How to avoid "unused variable in a for loop" error
  • Clipping a polygon to only draw within a circle in Love2D
  • Can't import library in Python
  • Silverstripe - Turn modules on or off in config
  • How does shared memory work behind the scene in Linux?
  • Vue - how to bind table column to a data object?
  • OrientDB deep traversal until specific class
  • Static code analysis of Dockerfiles?
  • Is Batmobile Defy Mini a fake device?
  • Reverse a list to a range
  • Add multiple y-axis to SAPUI5 VizFrame Column Charts
  • Nightmare with rabbitmq.client versions
  • How to change timeout for a request in okhttp
  • How to support relative date parameters in Web Intelligence Report
  • cfEngine3 - class if package is installed
  • Count number of sentences in a string in SAS
  • Visit Last Loaded URL
  • What are the use cases to substitute cookbook array attribute in chef?
  • shadow
    Privacy Policy - Terms - Contact Us © voile276.org