Second-Hand-Friends / kleinanzeigen-bot

A dilligent command line tool to publish ads on kleinanzeigen.de
GNU Affero General Public License v3.0
197 stars 43 forks source link

[BUG] Failed to set special attribute [kueche_esszimmer.color_s] #281

Closed euberdeveloper closed 1 month ago

euberdeveloper commented 5 months ago

✔️ Expected Behaviour

It whould work

🐞 Actual Behaviour

It gives the following error: TimeoutError: Failed to set special attribute [kueche_esszimmer.color_s]

📋 Steps to Reproduce

active: true
type: OFFER
title: XXX
description: XXX
category: 80l16387/86l16387
special_attributes:
  kueche_esszimmer.color_s: sonstige
  kueche_esszimmer.art_s: geschirr
  kueche_esszimmer.condition_s: ok
price: 7
price_type: NEGOTIABLE
shipping_type: NOT_APPLICABLE
shipping_costs:
shipping_options:
sell_directly:
images:
  - ad_yyy__img1.jpg
contact:
  zipcode: 'XXX'
  name: XXX
  street:
  phone:
republication_interval: 3
id: XXX
created_on: '2024-02-16T00:00:00'
updated_on:

📺 What browsers are you seeing the problem on? (if applicable)

No response

💻 What operating systems are you seeing the problem on? (if applicable)

No response

📃 Relevant log output (if applicable)


[INFO] Deleting ad 'YYY' if already present...
[INFO]  ... pausing for 1954 ms ...
[INFO] Publishing ad 'YYY'...
[INFO]  ... pausing for 2225 ms ...
[INFO]  ... pausing for 1690 ms ...
[INFO]  ... pausing for 1796 ms ...
[INFO]  ... pausing for 2484 ms ...
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
args ({'code': -32000, 'message': 'Invalid search result range'},) kwargs {}
args ({'code': -32000, 'message': "DOM agent hasn't been enabled"},) kwargs {}
[ERROR] TimeoutError: Failed to set special attribute [kueche_esszimmer.color_s]
[73099] Failed to execute script '__main__' due to unhandled exception!
successfully removed temp profile /home/XXX/.config/google-chrome

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
euberdeveloper commented 5 months ago

It actually does not work with all my adds, another example: TimeoutError: Failed to set special attribute [kleidung_damen.brand_s]

euberdeveloper commented 5 months ago

It is also very nerving, because it removes the ad without publishing it

PlanetDyna commented 5 months ago

I get a similar error when publishing a vehicle.

2024-03-23 16:46:19,952 [ERROR] TimeoutError: Failed to set special attribute [autos.ez_i]

euberdeveloper commented 4 months ago

Hallo, gibt est Neuigkeiten? Der Bot ist nicht mehr benutzbar

TylonHH commented 4 months ago

Also with [ERROR] TimeoutError: Failed to set special attribute [spielzeug.condition_s]

What I recognized: while publishining, the category is not choosen. This causes this ERROR. The Bot click on category and then clicks on "continue/weiter" without selecting a category.

TylonHH commented 4 months ago

What I found out: In my yaml of ad there was the category set to: 17l21871/23l21871 When I check online the link to the category it says: 17/23/gesellschaftsspiele So I replaced this in my yaml and this worked.

Seems the links to the categories have to be updated

Airwave1981 commented 3 months ago

Hi all,

facing the same issue. Seems that this only occurs on number fields?

Eg. have it on: autos.km_i: '30000' autos.ezm_i: '6' autos.ez_i: '2022' autos.power_i: '136'

Lists are working.

TylonHH commented 3 months ago

What I found out: In my yaml of ad there was the category set to: 17l21871/23l21871 When I check online the link to the category it says: 17/23/gesellschaftsspiele So I replaced this in my yaml and this worked.

Seems the links to the categories have to be updated

conclusion: while downloading an ad the category is red to 161l463/225l463. When I wanna (re)publish this ad I need this 161/225/festplatten_laufwerke. So do we need a mapping table? Or the logic to read the category while saving have to be changed. When I look into the sourcecode I also found this

dimensions: {"dimension1":"sVIP","dimension2":"161","dimension3":"225","dimension4":"festplatten_laufwerke","dimension6":"408","dimension7":"463", [...]

Airwave1981 commented 3 months ago

So I have the same issue with correct current category:

e.g.: category: 210/216/opel/corsa/

and issue on

autos.km_i: '30000' autos.ezm_i: '6' autos.ez_i: '2022' autos.power_i: '136'

provinzio commented 3 months ago

Does this PR solves your problem? https://github.com/Second-Hand-Friends/kleinanzeigen-bot/pull/308

Vel-San commented 2 months ago

+1

Bot is basically unusable at the moment because it deletes ads and cannot republish them.

Vel-San commented 2 months ago

What I found out: In my yaml of ad there was the category set to: 17l21871/23l21871 When I check online the link to the category it says: 17/23/gesellschaftsspiele So I replaced this in my yaml and this worked. Seems the links to the categories have to be updated

conclusion: while downloading an ad the category is red to 161l463/225l463. When I wanna (re)publish this ad I need this 161/225/festplatten_laufwerke. So do we need a mapping table? Or the logic to read the category while saving have to be changed. When I look into the sourcecode I also found this

dimensions: {"dimension1":"sVIP","dimension2":"161","dimension3":"225","dimension4":"festplatten_laufwerke","dimension6":"408","dimension7":"463", [...]

I don't think it needs any re-mapping. A quick fix is to take the value of art_s and append it to the category. When I view the categories on the Web they are like this, for example:

On Web, you can see the URL with category 80/81/[name] , where [name] is the art_s the bot is also saving in your ad file. Looks like a simple fix, however, the material, color, etc... values of the drop-down boxes are broken and the bot is still unusable until fixed.

The bot can find the category by itself for me, but it is unable to post anything because it cannot select the values for the dropdowns.

TylonHH commented 2 months ago

In my case the downloaded categories and the categories where it wanna upload it (again) are different named.

Vel-San commented 2 months ago

@euberdeveloper

I do have time now to open an PR, but for me a quick fix for the [category].color_s (or whatever .XXX) is was the following:

Replace:

https://github.com/Second-Hand-Friends/kleinanzeigen-bot/blob/effc91c269c2c1aa2e71ba7ac580cb0108160743/src/kleinanzeigen_bot/__init__.py#L687

With

await self.web_select(By.XPATH, f"//select[contains(@id, '.{special_attribute_key}')]", special_attribute_value)

The error is that the code is trying to find the exact key, but the ID has category.key instead (At least this is what I observered, and what has fixed my issue and was able to publish Ads again)

Make sure to follow this too before you start a publish process: https://github.com/Second-Hand-Friends/kleinanzeigen-bot/issues/281#issuecomment-2185001333

Vel-San commented 2 months ago

In my case the downloaded categories and the categories where it wanna upload it (again) are different named.

Can you give an example? For me I tried it with 5 Ads and it worked fine when I appended (if found) the art_s to the category in my config before I tried to publish again.