Web Scraping Using ChatGPT #openai #chatgpt #webscraping | extract data from website

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's try web scraping with chat GPT first choose a Target website like Amazon.com or imdb.com I am targeting this website booksthescrape.com and this is how it looked like it contains some books data like cover image of the book title rating price and few more I want to scrape all this data and I will ask chat GPT to write python code for me just go to chat GPT site and type webscratebookstoscrape.com using Python and beautiful soup in case you didn't notice I didn't mention what data I want to scrape and we will let chat GPT will figure it out on its own now chat GPT is generating our python code and it will be ready in few seconds as you can see here it's saying about some warning related to their policy just ignore it and our code is created in chunks so just type write code in one file and now it will merge all code in one place so it would be easy for us to copy and paste now code is ready let's copy this code and paste it in our app.py file save this file and run this using command python app.py look at this guys we just scrape a website successfully take a look at data we got title and price for every book from our Target URL what if I want more data let's say I want URL link to each book well it's easy just ask chatgpt to scrape URL link for each book now it will modify our code so that we can scrape title price and Link for each book let's copy this new code and paste it her save it and run this file boom now we are getting title price and URL link for each book let's go next level as you can see right now we are printing our code in console what if we want to export all this data into some file like CSV or Json or XML file well it's easy just ask chatgpt to export the data into CSV file and it will modify our code according to that let's copy this code and paste it save the file and then run this file as you can see we got nothing in our console but now we have a books.csv file generated here and this file contain all our data that we scraped from our Target website let's take a look there is one error here we got this weird character instead of pound sign this happens when we don't use utf-8 encoding while writing to file to correct this error just ask chatgpt to use utf-8 encoding and it will do some modification to our code let's copy this code and paste it save the file and then run this file now when open our book.csv file we can see a pound sign we can export data into Json format and we can web scrape some other website like Amazon or Ebay thank you for watching and see you in next video
Info
Channel: ChatGPT Tutorials
Views: 492,944
Rating: undefined out of 5
Keywords: chatgpt explained, chatgpt coding, chatgpt how to use, chatgpt examples, chatgpt api, OpenAI ChatGPT Tutorial for Beginners, openai chatbot gpt, chatgpt programming, chatGPT, openai chatgpt, ai chatbot, how to use openai, openai playground, openai codex, openai chatbot, openai, openai discord bot, what is open ai, playground openai, chat openai, how to use openai playground, coding with chatgpt, web scraping using chatgpt
Id: IMccv8xbguE
Channel Id: undefined
Length: 3min 8sec (188 seconds)
Published: Mon Dec 26 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.