jeudi 26 janvier 2017

Multiple 'if not in' conditions in python

I'm using beautifulsoup to web scrape. I originally had one condition I wanted to filter out, but I have some new conditions to narrow my results. I was using:

if "X" not in text:
    print text

Everything worked fine at this point. I have been trying to add conditions with different syntaxes, but it is causing a new problem and not solving my issue. I don't get any errors, but even my original condition is no longer getting filtered out. I'm new to python and coding in general, but I couldn't find a fix for this anywhere I checked. Any advice on the proper formatting for this would be greatly appreciated!

Aucun commentaire:

Enregistrer un commentaire