I wanna run a script to get pages

DOJO
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!
January 22, 2025

I have a script that get the pages from a space and change the content but I get some errors while running it's when it try to access to confluence with a token , can you provide me with a method that helps accessing to confluence or to solve the error 

1 answer

0 votes
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2025

Hi @DOJO 

 

Are you on the Cloud or Datacenter?  Please share the error you are getting as well as how you are authenticating via your script.

DOJO
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!
January 22, 2025

I think it's on a datacenter

here is the script: 

from atlassian import Confluence

# Replace these variables with your own details
confluence = Confluence(
    url='URL',
    token='pst'  # Use your personal access token here
)

# Fetch all pages from the specified space
space_key = 'SBUGS'  # Replace with your actual space key
content = confluence.get_all_pages_from_space(space_key)

# Print the content of the pages
for page in content:
    print(f"Title: {page['title']}, ID: {page['id']}")
and I get this error when running the script: 
Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1066)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events