0

I am getting error: Iconsistent use of tabs and spaces error when i try to add try and except error handling. I am trying to make script just skip to next url when one does not exist. Any help is welcome.

for url in get_lines(ARGS.urls_file):
    print("Downloading %s" % url)

    post_paths = refs_to_entries(download(url))
try:
    for ppath in post_paths[:POST_DOWNLOADED]:
        purl = with_path(url, ppath)

        print("Processing %s" % purl)

        marks = MarksCollector.get_all(download(purl))

        h2_marks = marks_inside_ptitle(marks)

        h2_marks = drop_empty_data(h2_marks)

        small = get_small_data(h2_marks)
        price = get_price_data(h2_marks)
        name = get_title_data(h2_marks)
        title = merge_title(name, price, small)

        #print(small, price, name, title, sep = '|||' )

        if title == None:
            print("Skipping (no title)")
            continue

        post = Post(purl, title, name, price, small)

        for ab in attrgroups_bounds(marks):
            for attr in parse_attrgroup(marks, ab):
                post.append_tag(attr[0], attr[1])

        posts.append(post)

    for p in posts:
        p.create_xml_node(root)

write_file(ARGS.output_xml, pretty(root))


time.sleep(SEND_TIMEOUT)

except:
    pass

1 Answers1

0

write_file(ARGS.output_xml, pretty(root))

time.sleep(SEND_TIMEOUT)

I think these two lines need to be indented.

허광호
  • 71
  • 1
  • 3