Skip to content
0:00 / 0:00

#debugging#python#htmlparsing

A First Bug - Software Debugging

Udacity

655K subscribers • 8 videos on Hallway

YouTube
  • Recommended by 1 person: 1 on Stack Overflow and its sister sites.

Beginner. No background in the topic needed.

3.4K views11 years ago1 recommendation

Tools and practiceProgramming languagesDebuggingPython

An introduction to finding and understanding a first software bug in Python as part of a debugging course.

This video is part of an online course, Software Debugging. Check out the course here: udacity.com/course/cs259.

Why it's here

1 person recommends this

What people say. Recommended as a simple demonstration of a bug in a Python HTML parsing function.

Igor Medeiroson Stack Overflow • Recommends

On “Strip HTML from strings in Python”

There's a simple way to this: def remove_html_markup(s): tag = False quote = False out = "" for c in s: if c == '<' and not quote: tag = True elif c == '>' and not quote: tag = False elif (c == '"' or c == "'") and tag: quote = not quote elif not tag: out = out + c return out The idea is explained here: link to this video You can see it working here: link to this video PS - If you're interested in the class(about smart debugging with python) I give you a link: http://www.udacity.com/overview/Course/cs259/CourseRev/1. It's free! You're welcome! :)

Igor Medeiroson Stack Overflow • Recommends

On “Python code to remove HTML tags from a string”

There's a simple way to this in any C-like language. The style is not Pythonic but works with pure Python: def remove_html_markup(s): tag = False quote = False out = "" for c in s: if c == '<' and not quote: tag = True elif c == '>' and not quote: tag = False elif (c == '"' or c == "'") and tag: quote = not quote elif not tag: out = out + c return out The idea based in a simple finite-state machine and is detailed explained here: link to this video You can see it working here: link to this video PS - If you're interested in the class(about smart debugging with python) I give you a link: https://www.udacity.com/course/software-debugging--cs259. It's free!