Text: The character code "\f068" is displayed as "?"

I need to retrieve the content value from my pseudo element.

script = "return window.getComputedStyle(document.querySelector('small.fa.text-muted.fa-minus'),':before').getPropertyValue('content');";
js = (JavascriptExecutor) webdriver;
content = js.executeScript(script);
System.out.println("content : " + content);

Css

.fa-minus:before {
    content: "\f068";
}

My code is returning "?" instead of "\f068". What could be causing this issue and how can I fix it?

Debugging:

https://i.sstatic.net/u0Dhv.png

Answer №1

One way you could achieve this using JavaScript is as follows:

var el = document.querySelector('.fa-minus'),
pseudoEl = window.getComputedStyle(el,'::after'),
content = pseudoEl.getPropertyValue("content"),
characterValue = '\\' + content.charCodeAt(1).toString(16);

console.log(characterValue);

I'm not entirely sure about the nuances between Java and JavaScript, so take my input with a grain of salt! :D

Check out this fiddle for more details.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Java implementation for parsing URLs and encoding website data

I am currently developing a program that takes the name of a city as input and displays the search results found. Once a result is selected, the program provides the latitude and longitude of the chosen city. However, I am facing an issue with encoding. S ...

Changing camera view in Three.js upon clicking an HTML button

My goal is to create a straightforward animation using three.js, HTML, and CSS. The concept involves generating multiple BoxGeometries within a for loop and adjusting the rotation of each box incrementally with each iteration. I have successfully achieved ...

Is Adsense flexibility the key to achieving the perfect fluid layout?

I've successfully created a CSS 3 column fluid layout, thanks to everyone's help! In my left column, I have a Google AdSense advert. Unfortunately, the sizes of these adverts are not very flexible. I'm wondering if there is a way to change t ...

Encountering a problem with a null variable in an XML file associated

When using DocumentBuilder Factory in JAVA to create an XML file, the "null" value is causing issues with the createTextNode() method. Element card_number = doc.createElement("number"); card_number.appendChild(doc.createTextNode(MYVALUE)); ...

Is there a way for Leiningen to directly install and utilize Java packages from Maven for my Clojure project?

Although I am comfortable with the Clojure / Leiningen / Clojars ecosystem, I am not as familiar with the Java / Maven ecosystem. Can I easily add a package from Maven.org to my project.clj file like I would with a clojar reference, or is there a differen ...

Spacing at the bottom of a table border

Currently, I have a table where I am utilizing CSS to display a bottom border. .inset { border-bottom: 1px solid #dadce0; } I am aiming to have some padding on the left and right sides similar to using a <hr align="center" width="80%">, but I ...

Ways to achieve an arched shadow effect for an image using React and Tailwind CSS?

Looking to add a unique touch to my React project with a shadow effect resembling an arch shape at the top of an image using Tailwind CSS. The ultimate goal is to create a semi-transparent arch-shaped shadow covering the top portion of the image, similar t ...

Why is the line height dimension missing from my model box when padding and margin are both set to 0?

I'm currently working on a project involving CSS/HTML and using Bootstrap 4 for my layout. I have a menu where I want the boxes to be the same size as the font-size, so I've set the margin and padding to 0. .menu-ppal { display: inline; li ...

Fixing the issue with CSS scrollbar swapping

I'm currently working on a template and facing a challenge that I can't quite comprehend. More specifically, I understand why it's happening, but I'm struggling to implement a cross-browser solution. The issue revolves around a fixed b ...

Using C# in a method as a variable

Working on test code in C# Visual Studio with Selenium, I have a few test classes and one Utility class. using ... namespace Test { [TestClass] public void Test1() { //CODE } [TestClass] public void Test2() { // ...

Compiler for Java ASN.1

Are there any non-GPL licensed ASN.1 Java Compilers available? I attempted to use bouncycastle, but it did not compile to Java. I am interested in checking out the Apache Harmony ASN.1 framework, however, it has been discontinued. ...

Concealed div obstructing access to dropdown menu

I'm having some trouble creating a dropdown menu. The submenu I've created is appearing behind my wrapper, page, and content. I've attempted to adjust the z-index of various elements and have even tried setting the z-index of my menu and sub ...

The date-picker element cannot be selected by html2canvas

I'm encountering an issue with Html2canvas while trying to capture a screenshot of my page. Specifically, the date shown in the date-picker on the page is not appearing in the screenshot. Do you have any insights into why this might be happening and h ...

Disabling the NavBar occurs when aligning it to the right

When attempting to align my NavBar to the right, I noticed that using float:right caused it to shift to the right but become unresponsive. Take a look here: goo.gl/46yUrt Snippet of Code: /** * 4.2 Navigation * --------------------------------------- ...

Modifying background according to TextView changes

I'm currently working on developing a straightforward android application using JAVA(Android Studio). My goal is to have the background color of the app change depending on the text displayed in the TextView, which will be constantly updated between t ...

Blurred border encircling a CSS circle styled with overflow: hidden;

Take a look at the JSFIDDLE of my cat animation without any drop-shadows to highlight the issue clearly. The problem appears to be related to the use of border-radius and possibly due to overflow: hidden. Just to clarify, the owl is not the focus of this ...

Creating a thumbnail with a close button using an image

My code is available at the following link: https://codepen.io/manuchadha/pen/PBKYBJ In this form I have created, I am trying to implement an image upload feature using a file input. The goal is to display a thumbnail of the selected image below the file ...

Instant crash when converting to JSON and from JSON

An issue arises with the code snippet causing it to crash, displaying the error message: Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING The problem lies in the following code block: Gs ...

Using Gson/Java to extract data from the Alpha Vantage API

While attempting to parse the JSON data using Gson, I encountered a recurring issue of receiving a Malformed JSON exception. com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Expected ':' at line 1 column 8 path ...

With Vue's new implementation of adding data attributes to the "*" selector, how can I adapt to this change?

Typically, I reset all margins/paddings by including the following code snippet at the beginning of my CSS: *, body { margin: 0; padding: 0; } This method usually works fine since it is overridden by subsequent selectors. However, Vue appends data att ...