I am working on a python script to port pages from Confluence to HubSpot. The script uses the Confluence API to retrieve page content and the HubSpot API to create new pages. However, I am encountering an issue with maintaining hyperlinks between pages when they are ported over.
Problem:
When porting a Confluence page (Document A) to HubSpot that contains a hyperlink to another Confluence page (Document B), the hyperlink should point to the new HubSpot URL of Document B. However, at the time Document A is created in HubSpot, Document B may not have been ported yet, resulting in a broken link.
Current Approach:
-
Retrieve Confluence Content: Fetch the content of the Confluence page using the Confluence API.
-
Parse and Modify Content: Use BeautifulSoup to parse the HTML content in Confluence
-
Create HubSpot Page: Use the HubSpot API to create a new page with the modified content.
I’m not certain how exactly to begin handling hyperlinked documents after they’ve been ported over. I’m trying to automate this so I don’t have to go in and change hyperlinks manually. Does anyone have any suggestions or resources that I could use to help me solve this issue?
John Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.