Code Monkey home page Code Monkey logo

Comments (6)

raff avatar raff commented on September 16, 2024 1

Also, if you are Italian and want to write in Italian, that works too :)

from godet.

raff avatar raff commented on September 16, 2024

I don't think you can. Chrome requires a tab to use the remote debugging APIs.

What you can do is start by creating an empty tab (with URL "about:blank") and then load your pages in it when you need to (via remote.Navigate). No need to stop Chrome or close the tabs.

As an alternative, if you only need the HTML, why do you want use Chrome vs. simple using Go net/http client ?

from godet.

nicolasassi avatar nicolasassi commented on September 16, 2024

Thanks for answering that fast!
My problem is that I'm trying to scrape a very trick website (LinkedIn/Sales/) which redirects simples GET requests to blank page even when using cookies in the request. I thought then to use godet or chomedp to open a chrome instance with which I could login in my account and then use the info from that logged page for scrapping. If I open new tabs using godet after the login page it works perfectly, but opening new tabs just for grabbing HTML is a lot of machine work and I have to open a huge amount of tabs.
Do you have any suggestions for my problem? I'm kind newbie at Golang and programming...

from godet.

raff avatar raff commented on September 16, 2024

Again, if manually you are accessing those pages in the same tab, do the same in your automated app. No need to open new tabs, unless the website requires it.

The other thing you can do is what you suggest, use godet to open a page in chrome and login, then get all the info you need (cookies, headers, whatever) and do the remaining requests via net/http client.

from godet.

nicolasassi avatar nicolasassi commented on September 16, 2024

I'm actually Brazilian, maybe my English is affected because of my mother language Portuguese haha
Would it be too much to ask you for some help with this thing I suggested (get all the info you need (cookies, headers, whatever))? As I said I'm new at programming and I'm trying to learn by my self so the chrome debugging protocol, http requests and all this stuff still very kind of a pain. I'm not even sure what info would I need for this task. Any help you could give (considering that this package you've done is a lot already) would be great!

from godet.

nicolasassi avatar nicolasassi commented on September 16, 2024

All I would like to know, if you could help, is how to get those info using godet and after that how to actually make the requests with this. I can't picture how complicated it can became, but if I have at least a kick start about how to do all of that I could keep studying to improve my code and fix possible erros. Thanks again Raff!

from godet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.