Logging into instagram via webview?

Hey, I’m trying to log into Instagram using a web view and the evaluate javascript method but it’s just not working. With a little debugging, my javascript code detects no inputs on the page! Here is my code below
const webview = new WebView();
let url = “https://www.instagram.com/accounts/login/
await webview.loadURL(url);

await webview.waitForLoad()
webview.present()
 getData = `
  function runit(){

const den = document.getElementsByTagName('input')[0] //to check input

    return den + "";
  }

  runit();
`

let response = await webview.evaluateJavaScript(getData, false);
console.log(response)

Try…

await webview.present()

Rather than the blank page …

… and undefined result that you get without the await…

… I then get the page load …

… and the DOM.

As an aside, do try to wrap all of your code in triple back ticks to make it a code block. Otherwise you lose the formatting and get unintentional smart quotes in your code, as in your post above.

Hope that helps.

Thanks SM man! I didn’t realize Instagram uses react therefore the DOM needed to be rendered before scraping. It all makes sense now! Thanks!