S
S
stasykk2018-02-24 21:40:45
Python
stasykk, 2018-02-24 21:40:45

Parsing not generating csv file?

Good day to all!
Here I wrote the Avito parsing code from the lesson: https://pastebin.com/CDM3fX8W
As a result, parsing does not create a csv file, and does not show any errors.
The only difference between me and the author of the lesson is the operating system, the author has linux, I have windows. I'm already in the process of installing on another hardware of the linux system, to make sure that the file is working for me, it's a pity for wasted time, but maybe someone knows the solution to the problem without such long manipulations?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan Krapivin, 2018-02-24
@stasykk

There are three errors in your code:
1) at the end, the if _name_ == '__main__' block got into the function, but it should be on its own
2) if _name_ == '__main__' the variable is written incorrectly. Not _name_ with single underscores, but double underscores. Like this: __name__
3) in a code block

if _name_ == '__main__':
  main()

you are trying to call the mai n () function. And the function mai l () is defined
.
The try - except blocks are also written in the code without defining the type of error, which means that these code sections will be silently skipped, and it will be impossible to understand why this code did not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question