second-hand-friends / kleinanzeigen-bot Goto Github PK
View Code? Open in Web Editor NEWA dilligent command line tool to publish ads on kleinanzeigen.de
License: GNU Affero General Public License v3.0
A dilligent command line tool to publish ads on kleinanzeigen.de
License: GNU Affero General Public License v3.0
Hi all,
I try around with use_private_window: false in the config.
If this is deactivated I don't get the privacy banner, so NoSuchElementException is raised.
I put a try catch around to get over this.
Maybe someone checks this an adds to code?
Thanks
Line 330 in init.py
# accept privacy banner
try:
self.web_click(By.ID, "gdpr-banner-accept")
except NoSuchElementException:
pass
Replace deprecated setup.py/distutils based build system with pdm supporting PEP 517,582, 621.
HI, after picture upload it crashed with
[INFO] -> uploading image [/home/admin/Downloads/kleinanzeigen-bot/Kleiderstaender1.jpg]
.....
[INFO] ... pausing for 2000 ms ...
[INFO] -> uploading image [/home/admin/Downloads/kleinanzeigen-bot/Kleiderstaender2.jpg]
...
[INFO] ... pausing for 2000 ms ...
[ERROR] NoSuchElementException: Message: Element id:pstad-submit not found or not clickable
I tried it manually, and there is an optional message for business user. Could this be the reason ?
I tried to pull the docker image like this:
docker pull ghcr.io/second-hand-friends/kleinanzeigen-bot
But I get an unauthorized error message:
Using default tag: latest Error response from daemon: Head "https://ghcr.io/v2/second-hand-friends/kleinanzeigen-bot/manifests/latest": unauthorized
I think this happens because the image is set to private.
Hi,
Debian stable only has python 3.9, with a dep on >= 3.10 we exclude a whole lot of users.
Which part of the code depends on 3.10 and can we change that to work with 3.9?
Hello,
since yesterday i have the problem that the ads doesn't publish anymore.
After the as is created the upload takes longer as the waiting time, so that the window closes / the next ad will publish before the ad is fully uploaded by kleinanzeigen.
is there a way to increase this time?
Investigate if/how the Windows exe can be digitally signed for free using sigstore/fulcio
https://github.com/sigstore/fulcio
https://docs.sigstore.dev/fulcio/overview
sigstore/fulcio#250
I get the following stacktrace when trying to install selenium with pip (pip install -t pypackages/3.10/lib selenium).
ERROR: Exception: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 223, in _main status = self.run(options, args) File "/usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper return func(self, options, args) File "/usr/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 320, in run requirement_set = resolver.resolve( File "/usr/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve self._result = resolver.resolve( File "/home/nash/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 481, in resolve state = resolution.resolve(requirements, max_rounds=max_rounds) File "/home/nash/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 348, in resolve self._add_to_criteria(self.state.criteria, r, parent=None) File "/home/nash/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 147, in _add_to_criteria matches = self._p.find_matches( TypeError: PipProvider.find_matches() got an unexpected keyword argument 'identifier'
OS: arch
App version: 0.1.dev1+g9196ed4
Not reproducible, ~ 80% of the time publishing doesn't work
[ERROR] NoSuchElementException: Message: Element id='postad-step1-sbmt' not found
Would it be possible to have an switch at the ad_*.yaml config to force the renew only once and toggle the switch after done, because of for example data update. Of course it would be also work to change the date but it would be easier to have an switch.
Placing an ad as "zu verschenken" I realized that the field Price is mandatory and it also must be > 0. But even when setting Price to 1 I could not publish the ad.
App version: 0.1.dev1+gc62528f
Excerpt from logfile
2022-03-12 12:20:03,572 [INFO] Processing 1/1: 'Sitzerhöhung' from [D:\Programme\ebay\ads\ad_kisi.yml]...
2022-03-12 12:20:03,572 [INFO] Deleting ad 'Sitzerhöhung' if already present...
2022-03-12 12:20:03,603 [INFO] ... pausing for 2000 ms ...
2022-03-12 12:20:06,978 [INFO] Publishing ad 'Sitzerhöhung'...
2022-03-12 12:20:09,898 [INFO] ... pausing for 2000 ms ...
2022-03-12 12:20:18,670 [INFO] ... pausing for 2000 ms ...
2022-03-12 12:20:27,911 [ERROR] NoSuchElementException: Message: None
If there are more than one source paths (wildcard patterns) given in an ad file, the images are not added in that specific order.
A CI test should be provided/implemented to test the chrome driver download mechanism on all platforms.
Why do we need this?
Sometimes it's more convenient to create an ad via the official ebay-kleinanzeigen app/website. Yet, you still want to add this ad to your kleinanzeigen-bot list of ads.
Solution proposal:
Introduce a new command download where you pass the ad ID. Hence, the description, properties, photos and categories shall be extracted and added to an ad-file.
Hi @ll,
ebay kleinanzeigen again worked on it, to make it more difficult for us:
(new device need to been accepted via an email button)
If you are fast enough, then you can drop the Link out of the email you get, into the browser. But afterwards the script crashes, due not handled procedure of course.
BUT(!), next time you are already logged in, when the script starts, if you setup a profile path and disabled a private window:
use_private_window: false
user_data_dir: "E:\chrome-profile"
Unfortunately the script starts then to relogin and the upper procedure starts again. :-(
Suggestion:
(1.) Would also allow then to run the script unattended
Allow online help, status and error messages to be displayed in English or German.
An importer / converter for the JSON file of the ebayKleinanzeigen script would be very helpful so that we don't have to start with zero again. The one time options are fine, it's likely faster to do it manually but converting the ads in the JSON to the new format would safe a lot of time.
I get this error
←[1;30m[INFO]←[0m Logging to [D:\unsortiert\Downloads\Kleinanzeigen-bot new\kleinanzeigen-bot.log]...
←[1;30m[INFO]←[0m App version: 0.1.dev1+g8e132d6
←[1;30m[INFO]←[0m Loading config from [D:\unsortiert\Downloads\Kleinanzeigen-bot new\config.yaml]...
←[1;30m[INFO]←[0m -> found 19 categories
←[1;30m[ERROR]←[0m ←[31mTypeError: string indices must be integers←[0m
[7640] Failed to execute script 'main' due to unhandled exception!
Seems the method of sorting the images has changed. Now they are uploaded in the wrong order.
I specifies
- img_.jpg
- img_.JPG
- img_.jpeg
- img_.JPEG
- img_.png
- img_.PNG
If I now have
img_01.JPG
img_02.jpg
02 gets uploaded before 01.
I tried specifying somethin like img_*.[jJ][pP][eE]?[gG] but that doesn't work. Please revert the change.
As mentioned in #5 there are several categories which need additional attributes to be filled in order to publish an ad. I've mainly stumbled over these mainly in the two categories Bicycle as well as categories, where there is only one additional dropdown - while exploring a bit in other categories I found even more fields in the House category, which is probably more of an edge-case and I didn't explore them further.
Auto, Rad & Boot > Fahrräder & Zubehör > Kinder
id="fahrraeder.type_s"
name="attributeMap[fahrraeder.type_s]"
Elektronik > Foto > Kamera & Zubehör
id="foto.condition_s"
name="attributeMap[foto.condition_s]"
As far as I can see, they don't have much in common, besides having an attributeMap in their name attribute, maybe that would be something to loop through when defined these maps in the ads config.
The phone number should be in double quoted, otherwise leading 0 will be deleted
Pyinstaller supports multiple platforms.
When trying to publish, I get the following notification. Unfortunately, it is not possible to complete the verification within 2 seconds manually, so it always fails and kleinanzeigen-bot crashes with
[1;30m[ERROR]�[0m �[31mTimeoutException: Message:
�[0m
[11348] Failed to execute script '__main__' due to unhandled exception!
The shipping cost key seems to not work correctly.
I tried like this:
shipping_cost: 6.99
But then the Bot enters a very long number into the corresponding field when creating the ad. This leads to an error because the pages input validations fails("value must be between 0 and 999") The bot itself then fails with some react field error.
Currently the script seems to delete ads either by ID or by Title.
Sometimes I do have two ads with the same title but different content. Now the first gets (re-)published. The second deletes the just republished ad cause it's on top of the older one and the title matches. So only the second ad remains online and the "old" second ad is still present cause the wrong one has been deleted.
I think it would be better to just delete by ad-id and ignore the title (or make it a config option)
More and more categories require a condition to be specified. An option to specify the default condition (usually used) would be helpful.
Sometimes a third-level category is required, how do I use it in an ad?
Example: In "Auto, Rad & Boot > Autoteile & Reifen" I'd like to use "Weitere Autoteile", which is selected in the art_s-dropdown.
Provide the app as a docker image.
the kleinanzeigen-bot fails to publish an add with phonenumber because the associated checkbox phoneNumberVisibility
must be ticked before entering details. similar to the addressVisibility
checkbox issue.
After re-publishing 46ads, I now have 82 online. So most old ones got not deleted. The same issue was present in the old script. In general, deleting was unreliable but maybe this script also only checks the first page of ads for the id, so all on page 2 and following are never deleted?
The app should be tested on Linux (incl. publishing some ads) to verify it's functionality.
The script prevents me from creating an ad with following values:
price:
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY
If I would use price: 0
this would be a GIVE_AWAY
. While using NEGOTIABLE
without a price is a valid scenario.
Issue with latest pre-release on Win 10 Pro X64
2022-06-19 16:16:00,678 [INFO] App version: 0.1.dev1+ga5347fc
2022-06-19 16:16:00,693 [INFO] Loading config from [D:\xxx\ebay\config.yaml]...
2022-06-19 16:16:00,756 [INFO] -> found 75 categories
2022-06-19 16:16:00,756 [INFO] Searching for ad config files...
2022-06-19 16:16:00,772 [INFO] -> found 0 ad config files
Older version I had around works:
2022-06-19 16:19:25,602 [INFO] App version: 0.1.dev1+g2a28cc4.d20220531
2022-06-19 16:19:25,617 [INFO] Loading config from [D:\xxx\ebay\config.yaml]...
2022-06-19 16:19:25,664 [INFO] -> found 75 categories
2022-06-19 16:19:25,664 [INFO] Searching for ad config files...
2022-06-19 16:19:25,680 [INFO] -> found 5 ad config files
Contrary to the old Kleinanzeigen script, the new bot requires specifying the option value instead of the text. This is not clear from the documentation i think. Would be better to mention what has to be entered.
Sometimes uploading an image fails. Instead of terminating the entire publishing process, the image upload should be retried at least once. If it fails again, either publish without the picture (a clear warning in the log should be provided) or continue with the next ad instead of terminating the process.
Maybe the choice publish without the failed picture or continue with the next ad should be a config option.
3 times of 4 runnings I will get this error
[ERROR] NoSuchElementException: Message: None
And the browser is showing an advertising picture after login.
Updated to lastest version 0.1.dev1+g2478014, can't publish any ads. Edit: brand-new 1d5fc64 doesn't work either.
No config change, no ad changes, Edge (v99).
Error is always NoSuchElementException: Message: None
I also deleted the older versions I kept - perhaps we ought to keep old pre-releases online?
I get this error when starting with first ad.
UnboundLocalError: local variable 'last_updated_on' referenced before assignment
With the change in line 163 it works
last_updated_on = False
The bot can not poste to the "Verleihen" category. I assume it is because it does not have a way to input a price.
The error is:
1;30m[ERROR]�[0m �[31mNoSuchElementException: Message: Element xpath='//select[@id='priceType']' not found or not clickable
Hi, I get the following error almost every time I try
[ERROR] Traceback (most recent call last):
File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/__main__.py", line 8, in <module>
kleinanzeigen_bot.main(sys.argv)
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/__init__.py", line 605, in main
KleinanzeigenBot().run(args)
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/__init__.py", line 77, in run
self.publish_ads(ads)
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/__init__.py", line 381, in publish_ads
self.publish_ad(ad_file, ad_cfg, ad_cfg_orig)
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/__init__.py", line 453, in publish_ad
self.web_input(By.ID, "pstad-street", ad_cfg["contact"]["street"])
File "/home/tegger/Downloads/kleinanzeigen-bot/kleinanzeigen_bot/selenium_mixin.py", line 305, in web_input
input_field.clear()
File "/home/tegger/Downloads/kleinanzeigen-bot/__pypackages__/3.10/lib/selenium/webdriver/remote/webelement.py", line 93, in clear
self._execute(Command.CLEAR_ELEMENT)
File "/home/tegger/Downloads/kleinanzeigen-bot/__pypackages__/3.10/lib/selenium/webdriver/remote/webelement.py", line 710, in _execute
return self._parent.execute(command, params)
File "/home/tegger/Downloads/kleinanzeigen-bot/__pypackages__/3.10/lib/selenium/webdriver/remote/webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "/home/tegger/Downloads/kleinanzeigen-bot/__pypackages__/3.10/lib/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidElementStateException: Message: invalid element state: Element is not currently interactable and may not be manipulated
(Session info: chrome=90.0.4430.212)
Stacktrace:
#0 0x55591421a7f9 <unknown>
#1 0x5559141ba3b3 <unknown>
#2 0x555913f02016 <unknown>
#3 0x555913f05659 <unknown>
#4 0x555913f0548e <unknown>
#5 0x555913f05714 <unknown>
#6 0x555913f2fa63 <unknown>
#7 0x555913f59dc2 <unknown>
#8 0x555913f2dd7b <unknown>
#9 0x555913f59fce <unknown>
#10 0x555913f6a9e1 <unknown>
#11 0x555913f59c93 <unknown>
#12 0x555913f2bce4 <unknown>
#13 0x555913f2d4d2 <unknown>
#14 0x5559141e6542 <unknown>
#15 0x5559141f5ce7 <unknown>
#16 0x5559141f59e4 <unknown>
#17 0x5559141fa13a <unknown>
#18 0x5559141f65b9 <unknown>
#19 0x5559141dbe00 <unknown>
#20 0x55591420d5d2 <unknown>
#21 0x55591420d778 <unknown>
#22 0x555914225a1f <unknown>
#23 0x7f05a7e8ffa3 start_thread
#24 0x7f05a70e5eff clone
There is a fullscreen ad, every time I tried to offer a Fritzbox to 161/225
I tried to use ublock
extensions: [uBlock-Origin.crx] # a list of .crx extension files to be loaded
but this seems to be wrong, ublock isn't loaded. Are there other workarounds ?
Problem with republishing ads:
`[ERROR] Traceback (most recent call last):
File "kleinanzeigen_bot_main_.py", line 8, in
File "kleinanzeigen_bot_init_.py", line 506, in main
File "kleinanzeigen_bot_init_.py", line 76, in run
File "kleinanzeigen_bot_init_.py", line 341, in publish_ads
File "kleinanzeigen_bot_init_.py", line 422, in publish_ad
File "kleinanzeigen_bot\selenium_mixin.py", line 225, in web_input
File "selenium\webdriver\remote\webelement.py", line 93, in clear
File "selenium\webdriver\remote\webelement.py", line 710, in _execute
File "selenium\webdriver\remote\webdriver.py", line 424, in execute
File "selenium\webdriver\remote\errorhandler.py", line 247, in check_response
selenium.common.exceptions.InvalidElementStateException: Message: invalid element state: Element is not currently interactable and may not be manipulated
(Session info: chrome=102.0.5005.63)
Stacktrace:
Backtrace:
Ordinal0 [0x00C1D953+2414931]
Ordinal0 [0x00BAF5E1+1963489]
Ordinal0 [0x00A9C6B8+837304]
Ordinal0 [0x00A9F0B4+848052]
Ordinal0 [0x00A9EF72+847730]
Ordinal0 [0x00A9F200+848384]
Ordinal0 [0x00AC1D4D+990541]
Ordinal0 [0x00AE449C+1131676]
Ordinal0 [0x00ABFC74+982132]
Ordinal0 [0x00AE46B4+1132212]
Ordinal0 [0x00AF4812+1198098]
Ordinal0 [0x00AE42B6+1131190]
Ordinal0 [0x00ABE860+976992]
Ordinal0 [0x00ABF756+980822]
GetHandleVerifier [0x00E8CC62+2510274]
GetHandleVerifier [0x00E7F760+2455744]
GetHandleVerifier [0x00CAEABA+551962]
GetHandleVerifier [0x00CAD916+547446]
Ordinal0 [0x00BB5F3B+1990459]
Ordinal0 [0x00BBA898+2009240]
Ordinal0 [0x00BBA985+2009477]
Ordinal0 [0x00BC3AD1+2046673]
BaseThreadInitThunk [0x777CFA29+25]
RtlGetAppContainerNamedObjectPath [0x779C7A7E+286]
RtlGetAppContainerNamedObjectPath [0x779C7A4E+238]
[3112] Failed to execute script 'main' due to unhandled exception!`
This error basically happens every few ads:
[ERROR] WebDriverException: Message: target frame detached
(Session info: chrome=99.0.4844.74)
Stacktrace:
#0 0x55d43b355e44 <unknown>
#1 0x55d43ad35bac <unknown>
#2 0x55d43ad1f02e <unknown>
#3 0x55d43ad1da23 <unknown>
#4 0x55d43ad1e068 <unknown>
#5 0x55d43ad1df94 <unknown>
#6 0x55d43ad26897 <unknown>
#7 0x55d43ad1fb26 <unknown>
#8 0x55d43ad20221 <unknown>
#9 0x55d43ad1fe1d <unknown>
#10 0x55d43ad1f226 <unknown>
#11 0x55d43ad1e651 <unknown>
#12 0x55d43ad1e3b3 <unknown>
#13 0x55d43ad37992 <unknown>
#14 0x55d43adafcf4 <unknown>
#15 0x55d43ad9bb53 <unknown>
#16 0x55d43ad64be2 <unknown>
#17 0x55d43ad6665c <unknown>
#18 0x55d43b384aaf <unknown>
#19 0x55d43b3a2102 <unknown>
#20 0x55d43b386b65 <unknown>
#21 0x55d43b3a2a86 <unknown>
#22 0x55d43b37bb61 <unknown>
#23 0x55d43b3bf537 <unknown>
#24 0x55d43b3bf716 <unknown>
#25 0x55d43b3d9d75 <unknown>
#26 0x7f9e6939d5c2 <unknown>
Likely some https request fails. Maybe just retry at least once before terminating the script?
Hi all,
while creating an ad short before or when adding pictures I get following error:
←[1;30m[ERROR]←[0m ←[31mInvalidElementStateException: Message: invalid element state: Element is not currently interactable and may not be manipulated
(Session info: MicrosoftEdge=101.0.1210.47)
Stacktrace:
Backtrace:
Microsoft::Applications::Events::EventProperties::unpack [0x00007FF6A342CC52+24658]
Microsoft::Applications::Events::time_ticks_t::time_ticks_t [0x00007FF6A336D342+539922]
Ordinal0 [0x00007FF6A2E70F05+659205]
Ordinal0 [0x00007FF6A2E744FA+673018]
Ordinal0 [0x00007FF6A2E7427B+672379]
Ordinal0 [0x00007FF6A2E74630+673328]
Ordinal0 [0x00007FF6A2EA2F6E+864110]
Ordinal0 [0x00007FF6A2EC769A+1013402]
Ordinal0 [0x00007FF6A2E9FF34+851764]
Ordinal0 [0x00007FF6A2EC79B0+1014192]
Ordinal0 [0x00007FF6A2EDB9E7+1096167]
Ordinal0 [0x00007FF6A2EC74B3+1012915]
Ordinal0 [0x00007FF6A2E9E440+844864]
Ordinal0 [0x00007FF6A2E9F848+849992]
Microsoft::Applications::Events::EventProperty::EventProperty [0x00007FF6A31317D8+120584]
Microsoft::Applications::Events::EventProperty::EventProperty [0x00007FF6A311CE1E+36174]
Microsoft::Applications::Events::EventProperty::EventProperty [0x00007FF6A312001C+48972]
Microsoft::Applications::Events::EventProperty::to_string [0x00007FF6A2F70716+30806]
Microsoft::Applications::Events::time_ticks_t::time_ticks_t [0x00007FF6A3374611+569313]
Microsoft::Applications::Events::time_ticks_t::time_ticks_t [0x00007FF6A3379044+588308]
Microsoft::Applications::Events::time_ticks_t::time_ticks_t [0x00007FF6A337919D+588653]
Microsoft::Applications::Events::time_ticks_t::time_ticks_t [0x00007FF6A338292E+627454]
BaseThreadInitThunk [0x00007FF92D6D7034+20]
RtlUserThreadStart [0x00007FF92E0E2651+33]
←[0m
I wanted to debug, but haven't debugged pdm projects yet.
Opened init.py in vscode, started debug but then get error No module named 'overrides' when trying to start debugging. (Wondering if should install pip overrides).
Maybe someone can point me to how I can debug this project suitable.
Thanks
When I go on holiday I like to delete all ads before leaving. Unfortunately that's not available in the script. An option to delete all ads (may even regardless if a yaml file is present) would be helpful.
Publishing Job Ads doesnt work because there is no price field.
The Code should be updated,so that it continues if there is no price field.
The app should be tested on macos (incl. publishing some ads) to verify it's functionality.
In category 210/217/damen/ there is no shipment option. If PICKUP is configured, it fails with the following error.
[ERROR] NoSuchElementException: Message: Element xpath://*[contains(@Class, "ShippingPickupSelector")]//label[text()[contains(.,"Nur Abholung")]]/input[@type="radio"] not found or not clickable
Maybe just ignoring the shipping type if there is no selection present is the better solution than aborting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.