Download articles with python



Publicado 27 feb 2024

Hello, I would like to use python script to download articles that are located on address such as.

https://support.example.com/hc/en-us/sections/224112129274-Knowledge-base.

U used following tutorial but it did not work for those articles I need it downloaded whatever was available at 

Endpoint = zendesk + '/api/v2/help_center/{locale}/articles.json'

 


0

2

2 comentarios

      Hey starskiin3d, you can download ALL articles using this script that creates a csv file with them:

      import requests
      import pandas as pd

      email = "name.surname@mycompany.com/token"
      token = "XXX"
      zendesk = "mycompany"

      credentials = (email,token)

      url = f"https://{zendesk}.zendesk.com/api/v2/help_center/articles"

      articles = []

      while url:
          response = requests.get(url,auth=credentials)
          data = response.json()
          df = pd.DataFrame(data['articles'])
          articles.append(df)
          url = data['next_page']
          
      all_articles = pd.concat(articles)

      all_articles.to_csv('all_articles.csv')

       

      To download only the articles in section number 224112129274 you can use the same script but modifying the url:

      url = f"https://{zendesk}.zendesk.com/api/v2/help_center/sections/224112129274/articles"

       

       

       

      0


      Hello!
       
      I'm sorry to hear that you had issues while following our tutorial. Let me go ahead and pull you into a ticket to get a better idea of your use case and review some code samples. 
       
       

      1


      Iniciar sesión para dejar un comentario.

      ¿No encontró lo que buscaba?

      Nueva publicación