Question: I'm trying to extract birthdate with Selenium (java & chrome) from 'about page' on Facebook's profile. How should I do it?

On Facebook 'about' tab there is an element that contains person's birthdate (if disclosed). I really would like to have it as a String. 
Example here: 
<https://www.facebook.com/zuck/about?lst=100002006436635%3A4%3A1570508289>

I've tried driver.findElementByXPath and driver.findElementByClassName as well as PartialLinkText. I've done this before in a different place and it worked, maybe I'm just doing something wrong here.

XPath code I've tried is here:

```
.findElementByXPath("//*[@class='_4bl9 _2pis _2dbl']");

.findElementByXPath("//*[contains(text(), 'birthdate')]");

```

Please guide me how should I locate this element or extract the birthdate

Answer: 
Most of the developers like JSON data as request and it's good practice in RESTful apis. why?

JSON format is `{key1: value1, key2: value 2,....}`

You are passing 

`this.http.post(this.basePath + this.modulePath + '/getArrayValue',{'test' : YOUR_ACTUAL_ARRAY})` 

form the front-end. The `httpClient.post(url,body,options?)` has `url` and `body` as mandatory. How can you get it in back-end? Since you have body only,

```
    public ResponseEntity<?> getArrayValues(@RequestBody List<String> test) {    
       // codes
    }

```

> 
> Key of passed parameter from front-end `test` and variable which
>  listens in back-end should be in same name. Otherwise
>  `@RequestBody("KEY_NAME") List<String> any_variable`
> 
> 
> 

As you asked from comment, you may have two key value pairs. Eg : `{ "test" : value1, "tmp": value2}`. Assume `value1` and `value2` both are String array. 

`this.http.post(this.basePath + this.modulePath + '/getArrayValue',{'myJson' : YOUR_JSON})`

There are lot of way(Eg : Gson,ObjectMapper etc). I use another way.

Create a class called TestTmpConverter 

```
class TestTmpConverter{
    List<String> test;
    List<String> tmp;

    //No-argument constructors & Argument constructors
    //Getters
}

```

In controller

```
public ResponseEntity<?> getArrayValues(@RequestBody List<TestTmpConverter> myJson ) {
    List<TestTmpConverter> test=myJson.getTest();
    List<TestTmpConverter> tmp=myJson.getTmp();

    // Do your work

}

```

I only showed one way.There are a lot of way to pass data to back-end like `@RequestParam, @PathVariable etc`. I feel now you get something how you can pass the data.
For your client put your data directly on POST's body:

```
public passingOfValues( test : Array<string> ) : Observable<Array<string>> {
    let headers = new Headers({ 'Content-Type': 'application/json'} );
    let options = new RequestOptions({ headers: headers); 

    let response = this.http.post(this.basePath + this.modulePath + '/getArrayValue',
                  test, options)
            .map(this.extractData)
            .catch(this.handleError);
            return response;
}

```

On your REST service use the `@RequestBody` annotation:

```
public ResponseEntity<?> getArrayValues(@RequestBody String[] test ) {
     logger.debug("@@@ Test if array has a size @@@" + test.size());

}

```