Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

KeyError on login

Faisal Ladak
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 20, 2021

Hello All,

This could be a newbie question. I am trying to use Python to read the page content using the following code. My Confluence instance is on-prem. Please advise why I am getting the KeyError.

from atlassian import Confluence
import os
from bs4 import BeautifulSoup
import pandas as pd

user = "name@confluence.mydomain.com"
api_key = os.environ["mytoken"]
server = "https://confluence.mydomain.com/whateverpage"

confluence = Confluence(url=server, username=user, password=api_key)
page = confluence.get_page_by_id(page_id=123456)

 

\Anaconda3\lib\os.py in __getitem__(self, key)
    673         except KeyError:
    674             # raise KeyError with the original key value
--> 675             raise KeyError(key) from None
    676         return self.decodevalue(value)
    677 

1 answer

0 votes
Fabian Lim
Community Champion
October 31, 2021

Take a look at this post. It provides more details on what you need to do: https://community.atlassian.com/t5/Confluence-questions/Confluence-API-How-get-page-content-with-Python/qaq-p/1459259

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events