How may I extract a specific keyword and sentence from a pdf file from different pages. My goal here is to grab a word I’m looking for. For example an equation and number how may I find it using python ? Here’s an example of my code it opens and extracts all the sentence from the pdf file now need to find a keyword specifically on the pdf file!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
How may I extract a specific keyword and sentence from a pdf file from different pages. My goal here is to grab a word I’m looking for. For example an equation and number how may I find it using python ? Here’s an example of my code it opens and extracts all the sentence from the pdf file now need to find a keyword specifically on the pdf file!
E\Users\jalej\OneDrive\Desktop\Python
Edit Selection Find View Goto Tools Project Preferences Help
pdf verison 1.py.py
pdf file extract.py
open pdf file.py
#importing the PyPDF2 module
import PyPDF2
B
4
5
6
11
12
13
14
7 #creating a pdf reader object
8 pdfReader=PyPDF2. PdfFileReader (pdfFileobj)
9
pdf scrapers\pdf file extract.py - Sublime Text (UNREGISTERED)
22
23
24
25
26
#creating a pdf file object and giving loaction of pdf file
pdfFileobj-open('C:/Users/jalej/Downloads/new artcle.pdf', 'rb')
#extracting text from page
print(pageObj.extractText())
15
16 #finally closing the pdf file object
pdfFileobj.close()
17
18
19
20
21
#creating a page object
pageObj=pdfReader.getPage (0)
Extract text.py
focused ultrasound; BBB, blood-brain barrier; CNS,
central nervous system; MRgFUS, magnetic resonance guided
focused ultrasound; EEG, electroencephalography; MRI,
magnetic resonance imaging;
X
Web Scraping.py
from pdfminer.high_level import extract_text
#extracting the text from page numbers 1-8
result = extract_text('C:/Users/jalej/Downloads/new artcle.pdf',page_numbers= [0,1,2,3,4,5,6,7])
print (result)
Transcribed Image Text:E\Users\jalej\OneDrive\Desktop\Python Edit Selection Find View Goto Tools Project Preferences Help pdf verison 1.py.py pdf file extract.py open pdf file.py #importing the PyPDF2 module import PyPDF2 B 4 5 6 11 12 13 14 7 #creating a pdf reader object 8 pdfReader=PyPDF2. PdfFileReader (pdfFileobj) 9 pdf scrapers\pdf file extract.py - Sublime Text (UNREGISTERED) 22 23 24 25 26 #creating a pdf file object and giving loaction of pdf file pdfFileobj-open('C:/Users/jalej/Downloads/new artcle.pdf', 'rb') #extracting text from page print(pageObj.extractText()) 15 16 #finally closing the pdf file object pdfFileobj.close() 17 18 19 20 21 #creating a page object pageObj=pdfReader.getPage (0) Extract text.py focused ultrasound; BBB, blood-brain barrier; CNS, central nervous system; MRgFUS, magnetic resonance guided focused ultrasound; EEG, electroencephalography; MRI, magnetic resonance imaging; X Web Scraping.py from pdfminer.high_level import extract_text #extracting the text from page numbers 1-8 result = extract_text('C:/Users/jalej/Downloads/new artcle.pdf',page_numbers= [0,1,2,3,4,5,6,7]) print (result)
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY