SEO help: Lists do not contain only <li> elements and script supporting elements (<script> and <template>) - pagespeed-insights

Page Speed Insights is giving me the following error message for Accessibility:
Lists do not contain only li elements and script supporting elements (script and template)
Below are the code snippets that are generating this message. I'm not quite sure what needs to be done here to stop generating the errors, any advice would be much appreciated!
<ul class="slide_tit swiper-pagination-clickable swiper-pagination-bullets">
<li class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 1">
<li class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2">
<li class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3">

Related

Excel IE Automation Identify and act upon Tab Strip 'css' Element (encore)

I thought I could figure this out based on an excellent answer that Yu Zhou gave me in response to my previous question on this same topic [https://stackoverflow.com/questions/63677723/excel-ie-automation-identifying-a-css-element]
From the picture above what I'm trying to accomplish is to press the "Block & Lot" tab so that I can enter the search criteria into the proper fields and activate the search button to find it.
The code that I have so far is:
htmlDoc.getElementById("ext-comp-1072__ext-comp-1073").setAttribute "class", ""
' Next line selects the "Block & Lot" tab
htmlDoc.getElementById("ext-comp-1072__ext-comp-1079").setAttribute "class", "x-tab-strip-active"
' Next line hides the "Address/Borough" fields
htmlDoc.getElementById("ext-comp-1073").setAttribute "class", "x-panel x-panel-noborder x-hide-display"
Which gets me to the point where the "Block & Lot" tab is activated (or so I believe it is) but whatever I try I can't get the fields below ('select a borough', 'enter block' and 'enter lot') to appear so that I can enter data into them. The html code for this section of the website is below:
<div id="ext-comp-1071" style="left: 150px; bottom: 0px; position: absolute;">
<div class=" x-tab-panel search-tab" id="ext-comp-1072" style="width: 510px;">
<div class="x-tab-panel-header x-unselectable x-tab-panel-header-plain" id="ext-gen79" style="width: 510px;">
<div class="x-tab-strip-wrap" id="ext-gen82">
<ul class="x-tab-strip x-tab-strip-top" id="ext-gen84">
<li id="ext-comp-1072__ext-comp-1073">
<a class="x-tab-strip-close" id="ext-gen87"></a>
<a class="x-tab-right" id="ext-gen88" href="#">
<em class="x-tab-left">
<span class="x-tab-strip-inner">
<span class="x-tab-strip-text ">Address</span>
</span></em></a></li>
<li class="x-tab-strip-active" id="ext-comp-1072__ext-comp-1079">
<a class="x-tab-strip-close" id="ext-gen89"></a>
<a class="x-tab-right" id="ext-gen90" href="#">
<em class="x-tab-left">
<span class="x-tab-strip-inner">
<span class="x-tab-strip-text ">Block & Lot</span>
</span></em></a></li>
<li id="ext-comp-1072__ext-comp-1087">
<a class="x-tab-strip-close" id="ext-gen91"></a>
<a class="x-tab-right" id="ext-gen92" href="#">
<em class="x-tab-left">
<span class="x-tab-strip-inner">
<span class="x-tab-strip-text ">ZIP Code</span>
</span></em></a></li>

Prestashop 1.7 attribute groups - check stock and apply css to unavailable combination

Prestashop option to hide unavailable attributes on product page doesn't work when attribute groups are used, for example color and size (for clothing shops).
I need to keep showing all possible combinations, but grey out (or strikethrough) the combinations with no stock.
Like this:
I tried several things.
In Prestashop 1.6 the following piece of code worked to apply css class (.out-of-stock-float-left) to unavailable combinations:
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{if {$group.attributes_quantity[{$id_attribute|intval}]} > 1} <!-- product in stock -->
<li class="input-container float-left">
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]"
value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</li>
{else} <!-- product out of stock -->
<li class="input-container out-of-stock-float-left">
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]"
value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</li>
{/if}
{/foreach}
</ul>
{/if}
When changing combinations there is an ajax request. I don't know how to grey out combinations with no stock and make them not clickable.
Thanks

VBA click at element in IE

I can't click on an element in the screen, it's not a button but works like one. I have successfully located it through the web inspector (I think) but I can't figure out the reason of why isn't working... Previously in my code I used the same code for clicking in a "Log in" button and it worked perfectly. Here it is the code:
Set objCollection = IE.document.getelementsbytagname("div")
For Each elem In objCollection
If IsObject(IE.document.getElementsByClassName("btn-group")) Then 'Scratchpad button clicking
If IsObject(IE.document.getElementsByClassName("pull-left fang-button fang-button-subtle no-margin ng-binding")) Then
Debug.Print "found it"
elem.Click
Exit For
End If
End If
Next elem
I'm trying to click in the element "Scratchpad" at the top of the page, Thanks in advance!
HTML:
<div class="btn-group" role="group" style="border:1px solid #ccc"> <a ng-class="{'active': !CrossSegmentConfig.showScratchPad && !CrossSegmentConfig.showGraph}" class="pull-left fang-button fang-button-subtle no-margin ng-binding active" ng-click="CrossSegmentConfig.showScratchPad=false; CrossSegmentConfig.showGraph=false;" style=""> <i class="fa fa-align-left"></i> Parameters </a> <a ng-class="{'active': CrossSegmentConfig.showScratchPad}" class="pull-left fang-button fang-button-subtle no-margin ng-binding" ng-click="CrossSegmentConfig.toggleScratchPad()" style=""> <i class="fa fa fa-columns"></i> Scratchpad </a> <a ng-class="{'active': CrossSegmentConfig.showGraph}" class="pull-left fang-button fang-button-subtle no-margin ng-binding" ng-click="CrossSegmentConfig.toggleGraph()"> <i class="fa fa-line-chart"></i> Plot </a> </div>
It's an Angular JS directive. Try either of the following 2
ie.document.querySelector("[ng-click*=toggleScratchPad]").click
ie.document.parentWindow.execScript "document.querySelector('[ng-click*=toggleScratchPad]').click();"

How can I use Selenium to click multiple plus buttons and show their entire content

I want to click and open multiple plus buttons and print out their texts. Here is the code that I have:
from selenium import webdriver
chrome_path=r"G:\My Drive\chrome_driver\chromedriver_win32\chromedriver.exe"
driver=webdriver.Chrome(chrome_path)
driver.get('https://meshb.nlm.nih.gov/treeView')
for links in driver.find_elements_by_css_selector('a.ng-scope'):
links.find_element_by_xpath("following-sibling::span").click();
for sublinks in links.find_elements_by_xpath("//*[#class='ng-scope']/span"):
print(sublinks.text)
here is what I see! the nodes' text is duplicated! and the code cannot open all the plus buttons. Only the first level plus buttons are opened, how can I change my code to be able to open all plus buttons, and once every plus button is open, I see the node'stext along with the whole content that is associated with it?
A part of html looks like this:
<a class="ng-scope">
<span class="ng-binding ng-scope">Anatomy [A]</span>
</a>
<ul class="treeItem ng-scope">
<li class ="ng-scope" >
< a class ="ng-scope" href="/record/ui?ui=D001829" >
< span class ="ng-binding ng-scope" > Body Regions[A01] < / span >
</a>
</li>
< li class ="ng-scope" >
<a class ="ng-scope" href="/record/ui?ui=D001829" >
< span class ="ng-binding ng-scope" > Cardio Vascular< / span >
</a>
<ul class="treeItem ng-scope">
<li class="ng-scope">
<a class="ng-scope" href="/record/ui?ui=D015824">
<span class="ng-binding ng-scope">Blood-Air Barrier [A07.025]</span>
</a>
<ul class="treeItem ng-scope">
<li class="ng-scope">
<a class="ng-scope" href="/record/ui?ui=D018916">
<span class="ng-binding ng-scope">Blood-Aqueous Barrier [A07.030]</span>
</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>

ExpressionEngine swtich tag working inconsistently

In ExpressioneEngine, I'm creating a list with conditionals that is returning some strange behavior. The code below is part of a bigger set:
<li><h4>DERMATOLOGY</h4>
<ul>
{exp:channel:entries channel="specialist" dynamic="no" orderby="sp_order" sort="asc"}
{if sp_specialty == "sp_dermatology"}
<li>
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/if}
{/exp:channel:entries}
</ul>
</li>
<li><h4>EMERGENCY AND CRITICAL CARE</h4>
<ul>
{exp:channel:entries channel="specialist" dynamic="no" orderby="sp_order" sort="asc"}
{if sp_specialty == "sp_emergency"}
<li class="{switch='one|two'}">
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/if}
{/exp:channel:entries}
</ul>
</li>
What happens, in the case of EMERGENCY AND CRITICAL CARE, is that with the 5 entries I have under that, the classes are returned like this: two, one, one, one, two. Any suggestions on getting the behavior I need?
I see what you mean. The switch variable applies its logic to all entries returned by the entries loop - which is why you're seeing odd numbering in your rendered page - because it's applying them to entries returned by the loop that you are then applying conditionals to in order to do your grouping. You could use the search param to do some of that for you, returning only the entries you're looking for within each loop. Like this:
<li><h4>DERMATOLOGY</h4>
<ul>
{exp:channel:entries channel="specialist" search:sp_specialty="=sp_dermatology" dynamic="no" orderby="sp_order" sort="asc"}
<li>
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/exp:channel:entries}
</ul>
</li>
<li><h4>EMERGENCY AND CRITICAL CARE</h4>
<ul>
{exp:channel:entries channel="specialist" search:sp_specialty="=sp_emergency" dynamic="no" orderby="sp_order" sort="asc"}
<li class="{switch='one|two'}">
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/exp:channel:entries}
</ul>
</li>
This way each loop returns ONLY the matching items you're looking for, eliminating the need for the conditional and allowing the switch param to operate as it wants to - applying itself in alternating fashion to every returned entry from the loop.

Resources