Python Forum
How to print particular text areas fron an HTML file (not site)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to print particular text areas fron an HTML file (not site)
#11
@Chris I saw the function you wrote before some data on the server was lost (sorry about that!). I dunno if you had the chance to see my reply. But anyway, the problem was that your function exited (return) as soon as first table cell closing tags were found (</a></t>).

Using BeautifulSoup would surely be easiest option to get the links out of your html. But if you really want to avoid it, then open a file and read lines. Search for some examples of with open and readlines(). You will need to do some manipulation because your lines won't be split by \n (which is default for text files), but by your custom delimiter (i suppose </a></t>).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,820 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  show csv file in flask template.html rr28rizal 8 34,526 Apr-12-2021, 09:24 AM
Last Post: adamabusamra
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,536 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Any way to remove HTML tags from scraped data? (I want text only) SeBz2020uk 1 3,414 Nov-02-2020, 08:12 PM
Last Post: Larz60+
  Open and read a tab delimited file from html using python cgi luffy 2 2,633 Aug-24-2020, 06:25 AM
Last Post: luffy
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,329 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  Web crawler extracting specific text from HTML lewdow 1 3,344 Jan-03-2020, 11:21 PM
Last Post: snippsat
  Help on parsing simple text on HTML amaumox 5 3,399 Jan-03-2020, 05:50 PM
Last Post: amaumox
  Sending file html ? JohnnyCoffee 3 57,505 Sep-06-2019, 04:32 PM
Last Post: snippsat
  Extract text between bold headlines from HTML CostasG 1 2,277 Aug-31-2019, 10:53 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020