How to Easily Scrape Websites with Python and Beautiful Soup (Web Scraping with Python)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ย. 2024

ความคิดเห็น • 29

  • @brucewernick6542
    @brucewernick6542 ปีที่แล้ว +1

    Great example. Just one thought. You start with a known named page. For me, it would be more useful to use the web site index and loop through all pages.

  • @David1449
    @David1449 ปีที่แล้ว +2

    Thank you Frank for your beautiful lesson

  • @davidwisemantel5041
    @davidwisemantel5041 3 ปีที่แล้ว +5

    This is a well planned out guide Frank! Well done. Can I ask you to create a video on scraping multiple google search queries, taking the first result link from each query? I can't find anything like this anywhere. Then you could also write the results to a DF / CSV.

    • @ThePyCoach
      @ThePyCoach  3 ปีที่แล้ว +3

      Thanks! It seems something you can easily accomplish with Selenium. You’d have to use the send_keys() method to introduce text on Google and then scrape the results.
      Check out my Selenium tutorial. I think I don’t use the send_keys() method there but it still can help.

  • @Sweet-tooth656
    @Sweet-tooth656 ปีที่แล้ว

    Thanks Frank for Cheat Sheet PDF, i really" need for learn deep python.

  • @frankbedon1012
    @frankbedon1012 2 ปีที่แล้ว +2

    Thanks Frank, that is a great video! However it did work at first for me I needed to add 'encoding="utf-8"' in 'with open(f'{title}.txt', 'w', encoding="utf-8") as file:' to be able to print in the file, not sure why ;)

    • @ThePyCoach
      @ThePyCoach  2 ปีที่แล้ว

      It has to do with the letters used in the transcript. Not all the letters are in the standard English alphabet, so you need to specify utf-8 as encoding to read them. That’s the most popular encoding all over the internet.

  • @aliyanpops6424
    @aliyanpops6424 3 ปีที่แล้ว +2

    Thanks to you for this tutorial, learned alot.

    • @ThePyCoach
      @ThePyCoach  3 ปีที่แล้ว +1

      You’re welcome!

  • @DianaMSosa-oi9lo
    @DianaMSosa-oi9lo 5 หลายเดือนก่อน

    OMG haha, I love the fact that you have the same video in englsih and Spanish.

  • @farazmubeen2739
    @farazmubeen2739 ปีที่แล้ว

    Thanks boys..Huge fan of your content

  • @denisquant
    @denisquant 3 ปีที่แล้ว +2

    What video about scrapping do you reccommend to see first? this or the previous? thx!

    • @ThePyCoach
      @ThePyCoach  3 ปีที่แล้ว +5

      Good question. My recommendation is to start with Beautiful Soup then Selenium and then Scrapy. I’m going to create a playlist soon to make things easier for all of you!

    • @denisquant
      @denisquant 3 ปีที่แล้ว

      @@ThePyCoach Thank you !

  • @UTTAMKUMAR-or6hq
    @UTTAMKUMAR-or6hq 2 ปีที่แล้ว +1

    Hi, Thanks for video. Can u suggest approach to follow to learn Data Science.

    • @ThePyCoach
      @ThePyCoach  2 ปีที่แล้ว +2

      I’m about to publish on Medium a Python for Data Science roadmap. Stay tuned!

  • @theinsideilluminater
    @theinsideilluminater ปีที่แล้ว

    Have you any video on email scraping?

  • @De7ka_7elwa
    @De7ka_7elwa 2 ปีที่แล้ว

    Amazing bro

  • @gameplay6751
    @gameplay6751 2 ปีที่แล้ว

    How I can rewrite this data before I upload it to my website. Please record video how we can rewrite the data after scrap it

  • @georgeabuya8385
    @georgeabuya8385 6 หลายเดือนก่อน

    It seems the Python Cheat Sheet on Web Scraping in no longer available!!

  • @averied909
    @averied909 4 หลายเดือนก่อน

    why are you parsing the website with xml?

  • @jethatchard1276
    @jethatchard1276 11 หลายเดือนก่อน

    nice

  • @dandumit
    @dandumit 3 ปีที่แล้ว +3

    what IDE is this ?

    • @ThePyCoach
      @ThePyCoach  3 ปีที่แล้ว +3

      It’s Pycharm, but feel free to use any Python text editor or IDE you want

    • @dandumit
      @dandumit 3 ปีที่แล้ว

      @@ThePyCoach do you recommend any that has also autocomplete ?

  • @wedeyforyou
    @wedeyforyou 5 หลายเดือนก่อน

    please start from how to install python

  • @informationdominance6434
    @informationdominance6434 2 ปีที่แล้ว +1

    Hey team - I had a few errors when running the code:
    Traceback (most recent call last):
    File "/titanic.py", line 18, in
    file.write(transcript)
    File "cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
    UnicodeEncodeError: 'charmap' codec can't encode character '\ufb02' in position 31207: character maps to

    • @ThePyCoach
      @ThePyCoach  2 ปีที่แล้ว +1

      This charmap error has to do with the encoding. Check the other answers or my GitHub to see how to deal with it

    • @shubhamsaxena3220
      @shubhamsaxena3220 2 ปีที่แล้ว +3

      Just write this --> encoding='utf8'
      Inside with open function