UniCourt / DataEngineering-Workshop1

MIT License
27 stars 427 forks source link

vivekananda_session1_4VP20CS026_HARSHITHA.K #32

Open sampleharvgithub opened 1 year ago

sampleharvgithub commented 1 year ago

No, there's no specific reason as such. It's just a random name given to the database.

On Sun, 23 Apr, 2023, 19:27 Anoosh Dsouza, @.***> wrote:

@.**** commented on this pull request.

In homework/web_scrapping1.py https://github.com/UniCourt/DataEngineering-Workshop1/pull/32#discussion_r1174586360 :

@@ -0,0 +1,38 @@ +import requests +from bs4 import BeautifulSoup +import sqlite3 + +conn= sqlite3.connect('cputest.db')

@sampleharvgithub https://github.com/sampleharvgithub Any reason for having the database name as "cputest" instead of a generic name which would indicate the purpose/data contained in that database?

— Reply to this email directly, view it on GitHub https://github.com/UniCourt/DataEngineering-Workshop1/pull/32#pullrequestreview-1396914490, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2DR5TCGX4R2NCWTCTTPKUTXCUYNNANCNFSM6AAAAAAXILKK7Y . You are receiving this because you were mentioned.Message ID: @.***>

sampleharvgithub commented 1 year ago

Yes I had checked it..and the database is displayed. The port used is 5432 because docker-compose is outside.

On Wed, 26 Apr, 2023, 08:03 Anoosh Dsouza, @.***> wrote:

@.**** commented on this pull request.

In homework/web_scraping_sample.py https://github.com/UniCourt/DataEngineering-Workshop1/pull/32#discussion_r1177273991 :

+import psycopg2 + + +#make a request to the website +url='https://blog.python.org/' +response=requests.get(url) + +#parse the html content using BeautifulSoup +soup=BeautifulSoup(response.content,'html.parser') + +#find all article titles and links +titles=soup.findall('h3',class='blog-title') +dates=soup.findall('h2',class='date-header')

  • +#connect to the PostgreSQL database +conn=psycopg2.connect(database="mydatabase",user="postgres",password="123456",host="localhost",port="5432")

@sampleharvgithub https://github.com/sampleharvgithub Have you tested this script from your end? If yes, did you verify that the data is getting saved in postgresql database that you've used?

— Reply to this email directly, view it on GitHub https://github.com/UniCourt/DataEngineering-Workshop1/pull/32#pullrequestreview-1401063165, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2DR5TH2TV6RFCOADKB6HFLXDCCRJANCNFSM6AAAAAAXILKK7Y . You are receiving this because you were mentioned.Message ID: @.***>