Puppeteer on Cloud Functions

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 56

  • @oscargutierrez1001
    @oscargutierrez1001 4 года назад +9

    Dude, I don't know if you are going to see this, but you just saved my life, I've been trying to use puppeteer in firebase to make a PDF from hbs template and save it to firebase storage, so far I was not able to do that, it gave me an error of "exceeded memory", but when you said to set the memory of the app to 1GB, I did it and it worked like a charm. Really love your videos, you just got a new sub :)

  • @user-ot1dv6ri4f
    @user-ot1dv6ri4f 6 лет назад +11

    yesss more puppeteer content please!

  • @DavidDiaz-wv6jr
    @DavidDiaz-wv6jr 4 года назад

    already implemented it but it fails when going to an angular path for example app.com/contact
    if it is only accessed through app.com it works wonders but if the page is reloaded through app.com/register firebase hosting says it doesn't exist

  • @aldenrivera2821
    @aldenrivera2821 2 года назад

    I implemented all that was done in the tutorial on my website, it still loads, and twitter cards were working even before implementing ssr. On the functions logs I can see ssr function being called and returning ok. But i dont see calls to the render function, how can I confirm if it's working properly?

  • @ibrahimmohammed3484
    @ibrahimmohammed3484 6 лет назад +1

    This video is similar to rendertron which i have been struggling with for weeks now with urls that has query params like ?x=2
    And the url encoding for the query characters

    • @Fireship
      @Fireship  6 лет назад +1

      You would need to encode/decode the params if using a query string. I believe rendertron does this, www.w3schools.com/tags/ref_urlencode.asp

    • @ibrahimmohammed3484
      @ibrahimmohammed3484 6 лет назад

      i do but angular router encodes the url as well, then when you send it to the /render endpoint that encoding coming from angular doesn't match the encoding the rendertron endcoding.
      the request.originalUrl in the cloud function you have created.
      if you please may take a look into this case and maybe you can help i would be grateful

  • @AlienAndrew51
    @AlienAndrew51 5 лет назад

    I'm trying to do something similar but I need to send two parameters URL and CSS selector. I'd like to resolve it to JSON. Do you think I'd still need the serialize script from Rendertron? The only problem with my code is that it takes the first parameter but won't attach the second param in the URL.

  • @BrettCooper4702
    @BrettCooper4702 6 лет назад +1

    More Puppeteer content would be great.

    • @simplyfabian
      @simplyfabian 5 лет назад

      I've got what you need on my channel ^_^

  • @vamshidharreddy5920
    @vamshidharreddy5920 4 года назад

    how do you learn so many things?

  • @harpymaslow
    @harpymaslow 6 лет назад +6

    Niiiiice. Thanks for this one too. I'm gonna use this for sure

  • @divyanshusah2809
    @divyanshusah2809 3 года назад +1

    I have set your Intro song in my Ringtone..❤❤❤

  • @mateja176
    @mateja176 6 лет назад +7

    Jeff just keeps making fantastic content, what a legend! On the topic of SSR, certain material components like the nav component seem to misbehave during rendering on the server ( i.e. nav renders half way through and looks nothing like the real deal ). Does anyone know a workaround?

    • @Fireship
      @Fireship  6 лет назад +1

      Thanks Mateja :) That happens with puppeteer rendering? It would be helpful to see a screenshot

    • @mateja176
      @mateja176 6 лет назад

      Thanks for the fast reply, I appreciate it! Link to repo: github.com/mytee306/puppeteer
      You can see a screenshot here github.com/mytee306/puppeteer/issues/1

    • @Fireship
      @Fireship  6 лет назад +1

      So it looks like it just doesn't know the source of static assets. Are you using the "serialize" function from render-tron? If not, that should fix the issue and you can use the code here github.com/AngularFirebase/130-cloud-functions-puppeteer

    • @mateja176
      @mateja176 6 лет назад

      Indeed, I'll take it for a run but this time using the "serialize" function. Hopefully, I'll be back with good news, thank you very much!

    • @mateja176
      @mateja176 6 лет назад

      Using serialize was a big step forward, only two things left
      Let renderer know where to find static assets
      and
      Figure out how to fix header and login buttons color and header items positioning ( might be a lack of an external stylesheet, hence will be fixed by including static files )

  • @mahmoudhafez8927
    @mahmoudhafez8927 2 года назад

    Much appreciation ♥♥
    How do you paste those chunks of code just like that in all of your videos?!!

  • @chriswilson8584
    @chriswilson8584 6 лет назад +2

    Nice. I just found out about Puppeteer a few days ago.

    • @Fireship
      @Fireship  6 лет назад

      It's an awesome tool and way easier to deploy now that it's on FCF

  • @pokerdrive8066
    @pokerdrive8066 Год назад

    I'm having this issue where I can't deploy a cloud function using puppeteer because it just can't find chrome's dependency :(

    • @andresgc7635
      @andresgc7635 3 месяца назад

      were you able to resolve it ? please help! :(

  • @alexartigas9181
    @alexartigas9181 6 лет назад

    Is this function quicker to resolve? I've been using your other dockerized Rendertron + Cloud Function tutorial through other projects and I usually get over 10scs for the function to finish (on payed Firebase accounts and no cold start). Most of the time Facebook bot just times out and doesn't show the rendered content... So it could be really interesting to try this other method if it's faster.

    • @Fireship
      @Fireship  6 лет назад

      I would not expect it to be faster unfortunately. The load time depends mostly on how quickly he frontend site loads.

    • @alexartigas9181
      @alexartigas9181 6 лет назад

      Too bad... I think there was a way to tell Rendertron to stop rendering at a certain point but I never got it to work. Since I really don't care too much about the content for social networks but about the head tags it would be a great way to reduce times. Maybe a topic for a short video? :)

  • @juansalassolbes9602
    @juansalassolbes9602 3 года назад

    and cors?

  • @alex-karpov-dev
    @alex-karpov-dev 6 лет назад

    Hello Jeff!
    Amazing as always!!!
    Is that better to use this approach instead of Rendertron? ( is this approach faster ? )

    • @Fireship
      @Fireship  6 лет назад

      Thank you :) It's probably not faster, but much easier to deploy and experiment with (and it's free).

    • @alex-karpov-dev
      @alex-karpov-dev 6 лет назад +1

      Angular Firebase, oh I got it. So we don't need a server working 24h per day and Pay for it ?

    • @Fireship
      @Fireship  6 лет назад +1

      Correct, just easier to maintain across the board.

    • @alex-karpov-dev
      @alex-karpov-dev 6 лет назад

      That's amazing!) Thanks for sharing

    • @alex-karpov-dev
      @alex-karpov-dev 6 лет назад

      BTW, does it work with regular firestore stuff, so with dynamic data in meta tags?

  • @harshitharshit6448
    @harshitharshit6448 5 лет назад +3

    Please make a video on same topic but for javascript not for typescript

  • @Youssefmahmoed
    @Youssefmahmoed 4 года назад

    Thanks for the awesome content 👍 but I've a question
    I've tried to use puppeteer to scrape data from Qwiklabs Public profile but i got "name resolution error"
    And this not only with Qwiklabs but with any other URL i try to scrape

  • @tokyodrigt
    @tokyodrigt 4 года назад +1

    Best youtube channel ever!!!

  • @jefferystartm9442
    @jefferystartm9442 3 года назад

    Brotherman made me a star and I'm not subscribed to pro just yet! Shout out

  • @i2.0Chillighosts
    @i2.0Chillighosts 4 года назад +1

    What is it about exactly?🥺😐🤨😕

  • @Raphi
    @Raphi 6 лет назад

    Does this not work on a free Firebase account? Do you need a paid account?

    • @pascalgehring9155
      @pascalgehring9155 4 года назад

      No it works just fine on a free Firebase account.

    • @JulienReszka
      @JulienReszka 3 года назад

      Nowadays you need a paid account to make requests outside your db

  • @info-namec768
    @info-namec768 6 лет назад +2

    AWESOME. Thanks !

    • @Fireship
      @Fireship  6 лет назад +1

      Thanks for watching Gustavo :)

  • @kagwad_in
    @kagwad_in 6 лет назад +1

    Sir please do complete tutorial on Ionic 4 not a basic vedios,,please do advance development with Ionic 4 . because of lack of resources we can't adore it easily please help.

    • @Fireship
      @Fireship  6 лет назад

      I have a bunch of Ionic4 vids planned :)

    • @kagwad_in
      @kagwad_in 6 лет назад

      @@Fireship please do sir ,,,there is lack resources on Ionic...and evryone doing only basic vedios... specially we have to understand Ionic typescripts sir.
      THANK YOU SO MUCH SIR FOR YOUR RESPONSE.

  • @carrillocarlosce
    @carrillocarlosce 6 лет назад +3

    what amazing tool, I see some useful cases for it. thanks..

    • @Fireship
      @Fireship  6 лет назад +1

      For sure. Web scraping, SSR, testing, crawling, etc.

  • @AbhishekKumar-mq1tt
    @AbhishekKumar-mq1tt 6 лет назад

    Thank u for this awesome video

  • @tevoj
    @tevoj 4 года назад

    Ok this video was nice, BUT: Do you want to master machine learning? ˜piano song˜

  • @boradmay
    @boradmay 6 лет назад

    Great helpful, thanks

  • @MaxOnMaxxer90
    @MaxOnMaxxer90 4 года назад +2

    I don't know if it's only me, but it seems like you make content for pretty advanced users. I really have a hard time following what you say because it's very technical without enough explanation, at least for me. I do think you have nice video's, but not super beginner friendly. Hopefully you will also do more content for beginners because I like your style. Good job!