- Home /
Question by
Julestorfs · Dec 07, 2018 at 05:45 PM ·
c#www
WWW login button doesn't have name or id
So I am trying to login programmatically with WWW into a website: https://dia.smartschool.be/login I fill in username and password with my script ,but I can't acces the login button by name or id. It only has a class and type. I can't login without the button. Is there another way for loggin in? Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Login : MonoBehaviour
{
public InputField username;
public InputField password;
string LoginURL = "https://dia.smartschool.be/login";
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void taskready()
{
Debug.Log("pressed");
StartCoroutine(LoginToSS(username.text, password.text));
}
IEnumerator LoginToSS(string ss_username, string ss_password)
{
WWWForm form = new WWWForm();
form.AddField("login_form[_username]", ss_username);
form.AddField("login_form[_password]", ss_password);
WWW www = new WWW(LoginURL, form);
yield return www;
Debug.Log(www.text);
Debug.Log(ss_username);
Debug.Log(ss_password);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612183528im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Retreive Jsonfile and Read It 0 Answers
WebClient on Android 0 Answers