Python Forum
Getting info from a file - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Getting info from a file (/thread-16044.html)



Getting info from a file - kwckwckwc - Feb-12-2019

I did a google search and saved it in a file, "page.html".

I am trying to grab the result count into a variable.

My attempts to use regular expressions all ended in total frustration and didn't work. I looked for "About*results" because the number is between those words. It didn't find the line at all. Even if it did, I'd still be struggling with getting the number out of the line.

Any help for a very poor programmer?

Ken


RE: Getting info from a file - Larz60+ - Feb-12-2019

count of what? records, characters, or ?


RE: Getting info from a file - nilamo - Feb-12-2019

https://www.regexpal.com/ is a great resource for interactively testing regexes out, to try to find one that works.

If you could share a snippet of what you're trying to extract, maybe we can help. But also, if it's an html page, you could try BeautifulSoup, and use element/css selectors to find the content node.