Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: string indices must be integers #736

Closed
yuis-ice opened this issue Dec 18, 2022 · 2 comments
Closed

TypeError: string indices must be integers #736

yuis-ice opened this issue Dec 18, 2022 · 2 comments

Comments

@yuis-ice
Copy link

The following gives me a result successfully:

// urls.yaml

kind: url
name: rakuten
url: https://www.rakuten-card.co.jp/campaign/add-card/
filter: "section[id='rule_detail']"
$ urlwatch --test-filter 29
<section id="rule_detail">
                    <div class="apply-lp-condition apply-lp-bg--gray apply-lp-py--lg">
                        <div class="mb-5">
// ..

When I add html2text in the chain, it starts to give me an error:

// urls.yaml

kind: url
name: rakuten
url: https://www.rakuten-card.co.jp/campaign/add-card/
filter: 
  - css: "section[id='rule_detail']"
  - html2text
$ urlwatch --test-filter 29
Traceback (most recent call last):
  File "/home/yuis/.local/bin/urlwatch", line 111, in <module>
    urlwatch_command.run()
  File "/home/yuis/.local/lib/python3.6/site-packages/urlwatch/command.py", line 293, in run
    self.handle_actions()
  File "/home/yuis/.local/lib/python3.6/site-packages/urlwatch/command.py", line 179, in handle_actions
    sys.exit(self.test_filter())
  File "/home/yuis/.local/lib/python3.6/site-packages/urlwatch/command.py", line 133, in test_filter
    raise job_state.exception
  File "/home/yuis/.local/lib/python3.6/site-packages/urlwatch/handler.py", line 90, in process
    filter_kind, subfilter = key, item[key]
TypeError: string indices must be integers
@thp
Copy link
Owner

thp commented Dec 18, 2022

Which version of urlwatch are you using?

See this: https://urlwatch.readthedocs.io/en/latest/deprecated.html#string-based-filter-definitions-since-2-19

@yuis-ice
Copy link
Author

I was on the version urlwatch 2.17. I upgraded to the latest urlwatch 2.25 the html2text problem has gone. Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants