Python Forum
Can we automate Java based Webservices
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can we automate Java based Webservices
#3
As mention bye @ndc85430 this is common task to do with Python.
Requests make it easy to do GET and POST request.
A example YouTube API,usually with big API you get a API key(free here) to use.
Example find how many subscriber a channel has,so insert key and channel id with f-string.
As a standard usually get JSON back,it's a dictionary when use it from Python.
import requests
 
api_key = 'xxxxxxxxxxxxxx'
channel_id = 'UC5kS0l76kC0xOzMPtOmSFGw' # chess.com
response = requests.get(f'https://www.googleapis.com/youtube/v3/channels?part=statistics&id={channel_id}&key={api_key}')
json_data = response.json()
print(json_data['items'][0]['statistics']['subscriberCount'])
Output:
285000
Reply


Messages In This Thread
RE: Can we automate Java based Webservices - by snippsat - Mar-24-2020, 09:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Web scraping and java script yoz69100 2 1,912 Oct-14-2019, 07:41 PM
Last Post: yoz69100
  Can i use selenium to automate electron based desktop application UI dharmendraradadiya 0 2,926 Jul-22-2019, 01:20 PM
Last Post: dharmendraradadiya
  Scrape java script web site PythonHunger 6 4,171 Oct-25-2018, 05:59 AM
Last Post: PythonHunger

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020