Google Maps Data Scraper/ Extractor using Python and Playwright (Free no external service) - Part 1

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

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

  • @ImranKhan-qv2sb
    @ImranKhan-qv2sb 11 หลายเดือนก่อน +2

    Thank you so much brother. Your video saved lots of my time and helped. Infect I have zero coding knowledge. Just followed your instructions its worked perfectly. Keep it up these good works. All the very best.

  • @NEO007
    @NEO007 28 วันที่ผ่านมา +1

    thnx for the video, but do u have a tutorial about scrolling down to the end of page in order to get all what we can ?

  • @user-dr6ij6xm7w
    @user-dr6ij6xm7w ปีที่แล้ว +2

    This is too amazing! Thank you so much for sharing. it's too helpful in my startup business :)

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

      Thank you! Glad it helped!

    • @user-dr6ij6xm7w
      @user-dr6ij6xm7w ปีที่แล้ว +1

      @@AminBoutarfi Worked awesome the other day but today I'm getting this error:
      result = next(iter(done)).result()
      playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
      =========================== logs ===========================
      waiting for locator("xpath=(//div[@role=\"article\"])[1]")
      ============================================================
      any solution?

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

      @@user-dr6ij6xm7w Yes same here. The role atricle has been removed :(

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

    This is amazing! Thank you so much for sharing! :)

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

      Thank you 🙏 more to come!

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

    Thank you so much for this video!

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

      Thank you for your support!

  • @mailsisuru
    @mailsisuru 5 หลายเดือนก่อน +1

    Everything works fine. But "name" column is blank. Something wrong in XPATH I think

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

    Hi Amin, firstly, thank you for this lesson, I feel more confident with pursuing the language. I do have an issue though , So I noticed the code is different on the github, around the listings area, I managed to get python to start chrome, open maps, input search box, it scrolls once then closes. I don't have any errors that i can see, I may just be missing a value.

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      Thanks for the support! This video is part 1, check the lastest part

  • @inassda
    @inassda 4 หลายเดือนก่อน +1

    how to implement all results, not just 5?

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

    Can you please show how to include the reviews as well?

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

      Good Idea! Will add that in the next Google Maps Scraping tutorial!

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

      @@AminBoutarfi I'm also waiting for this video.

  • @user-ql1xt8my8t
    @user-ql1xt8my8t ปีที่แล้ว +1

    bon courage 5oya kmal

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

    Hmm.. for some reason the name is coming up blank? I am looking for Courthouses in NC

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

      Working on an updated video/code!

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

    Do I simply need to download Python (and follow the code as per video) to scrape data from Google Maps? I am not a developer.

  • @Alvr267
    @Alvr267 15 วันที่ผ่านมา

    How to update the xpaths?? please

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

    Thank you for the video. By the way, on my computer it has different xpath because I use the exact same code with your video, the listings result 0 lists, is it possible?

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

    Could you show the code for using a Proxy service?

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

      Will do that in future video!

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

    Sir, it does not open the chrome but it prints zero as I change -l and -s values. what should I do?

  • @DaniloOjeda1
    @DaniloOjeda1 7 หลายเดือนก่อน

    I see when I make a search I can’t be specific. For example Latino restaurants in Dallas Texas. Only if I do restaurants in Texas USA.

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      I believe "Latino restaurants in Dallas Texas" works too, I just tried it

    • @DaniloOjeda1
      @DaniloOjeda1 7 หลายเดือนก่อน

      It just worked with the update you made in Github. Out of all the web scrapping videos I watched on TH-cam, you have been the fastest and easiest. One other question, do you have a script to located emails too? @@AminBoutarfi

  • @luongtruongmannguyen7569
    @luongtruongmannguyen7569 3 หลายเดือนก่อน

    Hi admin, thanks for you video. It help me so much. But I have a issue and I can't fix it. Can u help me?
    When I search for a specific address (Currently Scraped: 1), it won't continue and has an error in page.hover. Is there any way to fix it?

  • @latlov
    @latlov 3 หลายเดือนก่อน

    This series will be more useful if you teach how to crawl the comments for each business from Google maps, as well as the ratings, or filter by rating stars

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

    Arrived at all available
    Total Scraped: 120
    always stops at 120, but there are lots of businesses. But not continuing. Why? Do you have any solution?

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

      Yes that's a Google maps thing! Instead of searching in an entire city, you should search in multiple regions inside it for example since Google Maps will give the first 120 either ways.

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

      but still, 120 is too low for my search of interest. is there any way to do this thing properly? without limitation?

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

      Did you find a way to scrape more data

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

    how to add scrolling feature and I want to scrap data from multiple pages

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

      I added the scrolling feature to the Github repo. hope it helps!

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

    i don't know how to get the X-path, can you guide me, i tried but the output is like this //*[@id="QA0Szd"]/div/div/div[1]/div [3]/div/div[1]/div/div/div[2]/div[2]/div/div[1]/div[1]/h1/text()
    doesn't seem right. I tried pointing to the element then choosing copy path

  • @paulshealthfitness7922
    @paulshealthfitness7922 7 หลายเดือนก่อน

    thanks habibi this works, but how can i search multiple cities at once and leave it on over night? also can i have multiple chrome browsers running? thanks

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน +1

      I'm including that feature soon! Stay tuned

  • @user-vp8wf6cc3x
    @user-vp8wf6cc3x 10 หลายเดือนก่อน

    Hi, data is not being save in csv and excel

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

    I am getting this error: Looks like you launched a headed browser without having a XServer running. Set either 'headless: true' or use 'xvfb-run ' before running Playwright.
    Do you know what's wrong? Your help would be much appreciated

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

      I believe that you are running the script on a server without a UI.
      1- install xvfb
      2- run script as follows: xvfb-run python3 main.py -s= -t=
      Hope it helps!

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

    This video may have been released one year ago, but it’s still no longer relevant
    but his github code is still relevant

  • @user-xk9fb6gi6j
    @user-xk9fb6gi6j 11 หลายเดือนก่อน

    thank you

  • @user-vp8wf6cc3x
    @user-vp8wf6cc3x 10 หลายเดือนก่อน

    Data not saving in excel and csv

  • @edidombar121
    @edidombar121 10 หลายเดือนก่อน

    Hi Amin Thanks a lot for the video
    i am getting error while installing Playwright which mention couldn't build greenlet and need to install "pyproject.toml-based"
    Could you help me how to fix this?
    Thanks
    never mind, i have downgraded the python version and it works
    Thanks

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      Glad you fixed it. Whenever you come across that error, note that it's a version thing

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

    "playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded" facing this error. Can you please help me with it. Thanks in Advance :)

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

      By default playwright throws a timeout error after waiting 30000ms (30 seconds) in either:
      1- Internet was slow and didn't load page. In this case increase time out time: for example:
      page.goto('www.google.com/maps', timeout=60000). In here I'm playwright waits for 60 seconds.
      2- Or you asked for an elements that wasn't found. In this case for check if element is present on the page before scraping as follows:
      if page.locator('your xpath'). count>0:
      Element = page.locator('your xpath').
      Hope it helps!

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

      @@AminBoutarfi It worked. Thanks a ton.

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

      Hello ​ @AminBoutarfi after 2 problem (if page.locator('your xpath'). count() > 0: ) i have problem below . Could you please help me with it? Many Thanks.
      result = next(iter(done)).result()
      playwright._impl._api_types.Error: Error: strict mode violation: locator("xpath=//a[contains(@href, \"www.google.com/maps/place\")]").nth(9).locator("xpath=..").locator("xpath=//span[@role=\"img\"]") resolved to 2 elements:

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

      =========================== logs ===========================
      waiting for locator("xpath=//a[contains(@href, \"www.google.com/maps/place\")]").nth(2).locator("xpath=..").locator("xpath=//span[@role=\"img\"]")

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

    Hello Bro
    this is a good tuto but still there are some erorrs , the name coms blank, scrolling not working always shows the first result even the script shows that scrolling ...
    please check it more more time and make a new video or update your repo.
    Thank u

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

      Thanks for the feedback. Currently working on an Updated video/code. This is always the case with Web Scraping. If a website changes anything, we need to update the code so

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

    When I run program it only scrape 120 and I need 1k data is it possible to scrape huge Data

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

      You need setup user-agent and proxy aggregator for scrape huge data

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

      @@Faybmi how to set up do you have a tutorial

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

    How can we do For Multi Cities or Multiple Business at one time 😢😢

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

      Feature still not implemented. You need to extend the project! You would need to be able to read all input (for different cities..etc) from a file, and use something like multiprocessing or just remove the sleep time (use proxy to not be blocked)

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

    if page.locator('website_xpath').count>0:
    TypeError: '>' not supported between instances of 'method' and 'int'. Getting this error. Can you help me?

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

      Count is a method that you are calling! you should use count() "with parenthesis". Hope it helps!

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

      @@AminBoutarfi Thanks for the reply. Still getting this error - playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
      =========================== logs ===========================
      waiting for locator("xpath=//button[contains(@data-item-id, \"phone:tel:\")]//div[contains(@class, \"fontBodyMedium\")]")
      Could me please tell me how to use the if condition so that if any of the xpaths are not available, the script won't stop and scrape whatever is available.

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

      @@AminBoutarfi Just an update: I used the IF & ELSE statements before each xpath. However, the generated xlsx file and csv files have blank values. Can you please help me out with this?

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

      @@AminBoutarfi An example is -
      if page.locator('name_xpath').count('name_xpath') > 0:
      business.name = page.locator(name_xpath).inner_text()
      else:
      business.name = ""

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

      @@kunalsarmagermin8 Hi bro, did you can used if else statement for the case have no phonenumber ? could you share with me, I have a trouble with this. Tks

  • @BTouFik
    @BTouFik 3 หลายเดือนก่อน

    How we can earn money from this data?

  • @zimaremabwe
    @zimaremabwe 8 หลายเดือนก่อน

    how do i package it using Nuitka i m getting errors

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      I'm not familiar with Nuitka!

  • @IndianTech177
    @IndianTech177 9 หลายเดือนก่อน

    will this work on windows

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      Yes! On any computer OS I believe

  • @mohamedis4830
    @mohamedis4830 10 หลายเดือนก่อน

    Please could I search email address also ?

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      Unfortunately no! the reason is simple, There are no emails on Google Maps. You would need to get the websites, the go through them and search for emails

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

    please reply soon

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

    Hi, how can i contact you privately ? I would like to request a quote for a project

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

      Hey, here's my email: mr.amineboutarfi@gmail.com

  • @user-vp8wf6cc3x
    @user-vp8wf6cc3x 10 หลายเดือนก่อน

    Hi, data is not being save in csv and excel

  • @user-vp8wf6cc3x
    @user-vp8wf6cc3x 10 หลายเดือนก่อน

    Hi, data is not being save in csv and excel

    • @AminBoutarfi
      @AminBoutarfi  7 หลายเดือนก่อน

      Should be fixed!