4

Using this example, how do I retrieve the values of interaction on the electron page?

I am stuck at this

item_dict = item.get()
clm_dict = item_dict["claims"]
clm_list = clm_dict["P2069"]

for clm in clm_list:
   clm_trgt = clm.getTarget()

All I get is another itempage object. (python 3.6)

framawiki
  • 242
  • 1
  • 10
  • I tested the example given, in the rest of the loop there is the line `print(type(clm_trgt))`. I get that `clm_target` is of type `WbQuantity`, which should be correct... maybe you made a typo somewere in the code? Could you please post the entire code? – Russell Teapot Sep 05 '17 at 13:41
  • I don't know if it's relevant or not, but to make things quick and dirty I installed the package and set the environmen variable `PYWIKIBOT2_NO_USER_CONFIG` to 1. I'm not familiar with the API, though. – Russell Teapot Sep 05 '17 at 13:49
  • Setting `PYWIKIBOT2_NO_USER_CONFIG` should IMO not be problematic here, as you'll not edit any pages. Look at [the doc](https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation/fr#Configurer_Pywikibot) to learn how to generate a user config. – framawiki Nov 28 '17 at 17:54

0 Answers0