From 1b61d03c4b0a186152a79013f25c91d98a3a7020 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Mon, 4 Oct 2021 21:57:13 +0530 Subject: [PATCH 1/2] Adding project.txt --- project.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 project.txt diff --git a/project.txt b/project.txt new file mode 100644 index 0000000..a829b3b --- /dev/null +++ b/project.txt @@ -0,0 +1 @@ +https://ganeshmkavhar.000webhostapp.com/ \ No newline at end of file From 43a397c29d3d9cbb4542a12c21146e8bbb1f8382 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Mon, 4 Oct 2021 21:59:45 +0530 Subject: [PATCH 2/2] Updated code on basis of owner's given URL --- kickstarter.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/kickstarter.py b/kickstarter.py index 9f42b8b..8d19556 100644 --- a/kickstarter.py +++ b/kickstarter.py @@ -34,22 +34,14 @@ def error_reason(issue): structure = html.fromstring(project_page.content) -creator = str(structure.xpath(".//*[@id='content-wrap']/section/div/div[2]/div/div/div[2]/span[1]/a/text()")[0]).strip() -title = str(structure.xpath(".//*[@id='content-wrap']/section/div/div[2]/div/div/div[3]/h2/text()")[0]).strip() -description = str(structure.xpath(".//*[@id='content-wrap']/section/div/div[2]/div/div/div[3]/p/text()")[0]).strip() -backers = str(structure.xpath(".//*[@id='backers_count']/text()")[0]).strip() -backed_amount = str(structure.xpath(".//*[@id='content-wrap']/section/div/div[1]/div[2]/div[1]/div[3]/div[1]/span[1]/text()")[0]).strip() -pledged_amount = str(structure.xpath(".//*[@id='content-wrap']/section/div/div[1]/div[2]/div[1]/div[3]/div[1]/span[3]/span[1]/text()")[0]).strip() +creator = str(structure.xpath("/html/body/div[1]/div[1]/div[1]/div[1]/text()")[0]).strip() +title = str(structure.xpath("//span[contains(@class, 'txt-rotate')]/@data-rotate")).strip().replace("['[","").replace("]']","").replace('"','') +skills = str(structure.xpath("//div[contains(@class, 'skill')]//text()")).strip().replace('[','').replace(']','').replace('\'','') +education = [] +education.append(str(structure.xpath("/html/body/div[1]/div[2]/div[1]/div/div[2]/ul/li[1]//text()")).replace(',','').replace('\\n','').replace('\'','').replace('[','').replace(']','').strip().replace(' ',', ')) +education.append(str(structure.xpath("/html/body/div[1]/div[2]/div[1]/div/div[2]/ul/li[2]//text()")).replace(',','').replace('\\n','').replace('\'','').replace('[','').replace(']','').strip().replace(' ',', ')) print ("CREATOR: "+creator) print ("TITLE: "+title) -print ("DESCRIPTION: "+description) -print ("BACKED AMOUNT: "+backed_amount) -print ("PLEDGED AMOUNT: "+pledged_amount) - -backed_amount = int(backed_amount[1:].replace(",","")) -pledged_amount = int(pledged_amount[1:].replace(",","")) -backed_percentage = str(int((backed_amount/pledged_amount)*100)) + "%" - -print (backed_percentage + " FUNDED") -print ("BACKED BY: "+backers+" PEOPLE") +print ("SKILLS: "+skills) +print ("EDUCATION: "+str(education).replace('[','').replace(']','')) \ No newline at end of file